Popup=function(EvalID,url,ModalPU,successScript,params){this.config=new Array();this.config['dragOpacity']=80;this.config['normalOpacity']=100;this.config['opacityChangeRatio']=5;this.config['movingTracker']=0.50;this.config['movingInterval']=10;draggedObject=null;this.evalID=EvalID;this.element=null;this.successScript=successScript;this.ModalPopup=ModalPU;this.window=window;this.status="unbinded";this.ctor=function(url,params){if(url!=null){if(typeof(url)=='string'){this.element=document.createElement("div");this.element.innerHTML=this.fetchUI(url,params)
this.element=this.element.getElementsByTagName("*")[0];}
else{this.element=url.document.getElementById(this.evalID+"UI");this.status="semibinded"}}
else{this.element=document.getElementById(this.evalID+"UI");this.status="semibinded"}}
this.moveInitiated=function(ev){var recycle=false;var scrollPosY=Popup.getScrollY();var scrollPosX=Popup.getScrollX();var deltaTop=(this.currentTopPos+scrollPosY)-parseInt(this.element.style.top,10);var deltaLeft=(this.currentLeftPos+scrollPosX)-parseInt(this.element.style.left,10);if(Math.abs(deltaTop)>5){deltaTop*=this.config['movingTracker'];this.element.style.top=parseInt(this.element.style.top,10)+Math.round(deltaTop)+"px";recycle=true;}
else
if(deltaTop!=0){this.element.style.top=(this.currentTopPos+scrollPosY)+"px";}
if(Math.abs(deltaLeft)>5){deltaLeft*=this.config['movingTracker'];this.element.style.left=parseInt(this.element.style.left,10)+Math.round(deltaLeft)+"px";recycle=true;}
else
if(deltaLeft!=0){this.element.style.left=(this.currentLeftPos+scrollPosX)+"px";}
if(recycle)
window.setTimeout("try{"+this.evalID+".moveInitiated()}catch(e){}",this.config['movingInterval']);}
this.closePrevDialogs=function(){if(this.ModalPopup!=null&&this.ModalPopup!=window)
this.ModalPopup.closePrevDialogs();this.closeDialog();}
this.closeAllPopups=function(){var popups=getElementsByCondition(function(el){return(el.getAttribute('EvaluationID')!=null&&el.getAttribute('EvaluationID').indexOf("pu_")>-1);});for(var i=0;i<popups.length;++i)
if(popups[i].CtrlClass!=null&&popups[i].CtrlClass()!=null)
popups[i].CtrlClass().element.style.display="none";}
this.hide=function(){this.element.style.display="none";this.onHide();}
this.bind=function(){this.onInit();this.onBeforeShow();this.element.style.position="absolute";this.element.style.zIndex=2;if(this.status=="unbinded")
{this.element.style.display="none";this.element.style.top="0px";this.element.style.left="0px";document.body.appendChild(this.element);}
this.status="binded";}
this.show=function(){if(this.status!="binded"){this.bindToUI();this.bind();}
else{this.onBeforeShow();}
this.setVisDefaults();this.onShow();}
this.onInit=function(){}
this.onFocus=function(){}
this.ShowToolTip=function(){}
this.HideToolTip=function(){}
this.onBeforeShow=function(){fader.doFade();}
this.onShow=function(){}
this.onMove=function(){}
this.onDragged=function(){}
this.onBeforeFocus=function(){}
this.onHide=function(){if(this.ModalPopup!=window){return;}
fader.doUnFade();}
this.onSuccess=function(){if(!isNullOrUndefined(this.successScript)){eval(this.successScript);return false;}
else
return true;}
this.fetchUI=function(url,params){try{if(UserhLine!=undefined&&UserhLine!=null){document.getElementsByTagName("form")[0].appendChild(Constants.ajaxImageL);this.centerObject(Constants.ajaxImageL);}}
catch(e){}
var res=iMedix.Web.Helpers.PopupHelper.GetPopupContent(url,this.evalID,params);try{Constants.ajaxImageL.parentNode.removeChild(Constants.ajaxImageL);}catch(e){}
return res.value;}
this.centerObject=function(obj){var scrollPosY=Popup.getScrollY();var scrollPosX=Popup.getScrollX();var windowHeight=Constants.isIE?document.documentElement.clientHeight:window.innerHeight;var windowWidth=Constants.isIE?document.documentElement.clientWidth:window.innerWidth;var posY=((windowHeight-this.element.clientHeight)/2);var posX=((windowWidth-this.element.clientWidth)/2);obj.style.top=(this.currentTopPos=posY)+(scrollPosY)+"px";obj.style.left=(this.currentLeftPos=posX)+(scrollPosX)+"px";}
this.setVisDefaults=function(){this.element.style.display="";this.centerObject(this.element);}
this.closeDialog=function(ev){this.element.style.display="none";this.onHide();if(this.ModalPopup!=null&&this.ModalPopup!=window)
this.ModalPopup.show();if(this.element.parentNode!=null)
this.element.parentNode.removeChild(this.element);eval(this.evalID+"=undefined");}
this.onDragStart=function(ev){var posX=parseInt(this.element.style.left,10)-document.documentElement.scrollLeft;var posY=parseInt(this.element.style.top,10);this.startPointer=new Pointer(ev.clientX-posX,ev.clientY-posY);draggedObject=null;this.element.smoothOpacity(this.config["dragOpacity"]);document.body.onmousedown=function(ev){if(draggedObject!=null){ev=(ev==null)?event:ev;eval(draggedObject).onDragEnd(ev)}}
document.body.onmouseup=function(ev){if(draggedObject!=null){ev=(ev==null)?event:ev;eval(draggedObject).onDragEnd(ev)}}
document.body.onmousemove=function(ev){if(draggedObject!=null){ev=(ev==null)?event:ev;eval(draggedObject).onPanelDrag(ev)}};}
this.onDragEnd=function(ev){if(draggedObject!=null)
this.onDragged(ev);draggedObject=null;this.startPointer=null;this.element.smoothOpacity(this.config["normalOpacity"]);}
this.onPanelDrag=function(ev){if(this.startPointer!=null){if(draggedObject==null){draggedObject=this.evalID;}
this.element.style.left=(this.currentLeftPos=(ev.clientX-this.startPointer.X))+"px";this.element.style.top=(this.currentTopPos=(ev.clientY-this.startPointer.Y))+"px";var scrollPosY=Popup.getScrollY();var scrollPosX=Popup.getScrollX();this.currentTopPos-=scrollPosY;this.currentLeftPos-=scrollPosX;}}
this.bindToUI=function(){this.element.setAttribute("EvaluationID",this.evalID);scripts=getElementsByCondition(function(el){return(el.tagName.toLowerCase()=="script");},this.element);for(var i=0;i<scripts.length;++i){eval(scripts[i].innerHTML);scripts[i].parentNode.removeChild(scripts[i]);}
this.element.CtrlClass=function(){return eval(this.getAttribute("EvaluationID"));}
var meanings=getElementsByCondition(function(el){return(el.getAttribute("meaning")!=null);},this.element);for(var i=0;i<meanings.length;++i){eval(this.evalID+"."+meanings[i].getAttribute("meaning")+"=meanings[i]");}
this.WireInfraEvents();}
this.focus=function(){var result=false;if(this.window.document.body.lastChild!=this.element){this.onBeforeFocus();this.window.document.body.appendChild(this.element);result=true;}
this.onFocus();return result;}
this.WireInfraEvents=function(){this.element.onkeypress=function(ev){ev=(ev==null)?event:ev;if(ev.keyCode==27)
this.CtrlClass().onClose();}
this.element.setOpacity=function(opacity){this.style.filter="alpha(opacity:"+opacity+");";this.style.opacity=opacity/100;}
this.element.onmousedown=function(ev){ev=(ev==null)?event:ev;var which=ev.which||ev.button;if(which!=1)
return false;var clickedElement=Constants.isIE?ev.srcElement:ev.target;allowDragAtt=clickedElement.getAttribute("allowdrag");if(allowDragAtt!=null&&eval(allowDragAtt)==true)
this.CtrlClass().onDragStart(ev);if(this.CtrlClass().focus()){if((clickedElement.tagName)&&clickedElement.tagName!="A"){clickedElement.focus();}
else{if(Constants.isIE)
clickedElement.click();}}}
this.element.onmouseup=function(ev){ev=(ev==null)?event:ev;this.CtrlClass().onDragEnd(ev);}
this.element.onmousemove=function(ev){ev=(ev==null)?event:ev;this.CtrlClass().onPanelDrag(ev);}
this.element.smoothOpacity=function(opacity,curOpacity){return;if(curOpacity==null)
{curOpacity=this.CtrlClass().opacity;if(this.fadeHandler!=null)
window.clearTimeout(this.fadeHandler);}
if(Math.abs(opacity-curOpacity)>this.config['opacityChangeRatio']){var newOpacityGrade=curOpacity+(this.config['opacityChangeRatio']*((opacity-curOpacity)/Math.abs(opacity-curOpacity)));this.setOpacity(newOpacityGrade);this.fadeHandler=window.setTimeout(this.getAttribute("EvaluationID")+".element.smoothOpacity("+opacity+", "+newOpacityGrade+")",10);}
else{this.setOpacity(opacity);this.CtrlClass().opacity=opacity;}}}
this.ctor(url,params);}
window.onscroll=function(ev)
{ev=(ev==null)?event:ev;Popup.scrollInitiated(ev)}
Popup.scrollHandler=null;Popup.scrollInitiated=function()
{if(this.scrollHandler!=null)
{window.clearTimeout(this.scrollHandler);}
this.scrollHandler=window.setTimeout("Popup.handleScroll()",500);}
Popup.getScrollX=function()
{return Constants.isIE?document.documentElement.scrollLeft:window.pageXOffset;}
Popup.getScrollY=function()
{return Constants.isIE?document.documentElement.scrollTop:window.pageYOffset;}
Popup.handleScroll=function(ev)
{candidatePanels=getElementsByCondition(function(el){return(el.getAttribute('autocenter')&&el.getAttribute('EvaluationID')!=null);});for(var i=0;i<candidatePanels.length;++i)
{if(candidatePanels[i].CtrlClass()!=null)
{candidatePanels[i].CtrlClass().onMove();candidatePanels[i].CtrlClass().moveInitiated();}}}
function Pointer()
{var x;var y;if(arguments[0]!=null)
x=arguments[0];if(arguments[1]!=null)
y=arguments[1];this.X=x
this.Y=y;}
backgroundFader=function(myName,optionalZIndex){this.config=new Array();this.config['fadeInterval']=15;this.config['timeInterval']=10;this.config['maxOpacity']=60;this.config['fadingColor']="#f7f8fa";this.FadeHandler=null;this.doUnFade=function(){this.curOpacity=0;this.leveledFade();}
this.doFade=function(onMouseDown){if(this.backDiv.style.display=="")
return;if(this.backDiv.parentNode==null){frmiMedixSearch.appendChild(this.backDiv);this.backDiv.setAttribute("onRemove",onMouseDown);this.backDiv.onmousedown=function(){eval(this.getAttribute("onRemove"))}}
this.backDiv.style.width=Math.max(document.body.scrollWidth,document.documentElement.clientWidth)+"px";this.backDiv.style.height=Math.max(document.body.scrollHeight,document.documentElement.clientHeight)+"px";this.backDiv.style.display="";this.curOpacity=this.config['maxOpacity'];this.leveledFade();this.controlInputElements(false);}
this.leveledFade=function(opacity){if(opacity==null){if(this.FadeHandler!=null){window.clearTimeout(this.FadeHandler);this.FadeHandler=null;}
opacity=(this.curOpacity==0)?this.config['maxOpacity']:0;}
if(Math.abs(opacity-this.curOpacity)>=this.config['fadeInterval']){opacity+=((opacity-this.curOpacity<0)?1:-1)*this.config['fadeInterval'];this.FadeHandler=window.setTimeout(this.id+'.leveledFade('+opacity+')',this.config['timeInterval']);}
else{opacity=this.curOpacity;}
this.setBackOpacity(opacity);if(opacity==0){this.backDiv.style.display="none";this.controlInputElements(true);}}
this.controlInputElements=function(boolSetToShow){selectArrays=document.getElementsByTagName("select");for(i=0;i<selectArrays.length;++i)
if(selectArrays[i].attributes['doNotHide']==null)
selectArrays[i].style.visibility=boolSetToShow?"visible":"hidden";}
this.setBackOpacity=function(opacity){opacity=(opacity==100)?99.999:opacity;this.backDiv.style.filter="alpha(opacity:"+opacity+")";this.backDiv.style.KHTMLOpacity=opacity/100;this.backDiv.style.MozOpacity=opacity/100;this.backDiv.style.opacity=opacity/100;}
this.backDiv=document.createElement("div");this.backDiv.style.backgroundColor=this.config['fadingColor'];this.backDiv.style.position="absolute";this.backDiv.style.left=this.backDiv.style.top="0px";this.backDiv.style.display="none";this.backDiv.id="backDiv";this.curOpacity=0;this.setBackOpacity(this.curOpacity);this.id=myName;}
var fader=new backgroundFader("fader");function showTooltip(id,Text,CssClass,ev)
{var tt=null;try{tt=eval(id);}
catch(e){tt=eval(id+"=new Tooltip(id, CssClass, Text)");}
tt.show(ev,Text);}
Tooltip=function(EvalID,CSSClass,Text)
{this.config=new Array();this.config['dragOpacity']=80;this.config['normalOpacity']=100;this.config['opacityChangeRatio']=15;this.evalID=EvalID;this.element=null;this.ctor=function(CSSClass,Text)
{this.element=document.createElement("div");this.element.style.display="none";this.element.setAttribute("EvaluationID",this.evalID);this.element.className=CSSClass;var closeButton=document.createElement("div");closeButton.className="closeButton";closeButton.onclick=function(){this.parentNode.CtrlClass().hide()};this.TextContainer=document.createElement("p");this.TextContainer.innerHTML=Text;this.element.appendChild(closeButton);this.element.appendChild(this.TextContainer);document.body.appendChild(this.element);this.WireUpAbilities();}
this.show=function(ev,text,hideInXSec)
{this.TextContainer.innerHTML=text;this.element.setOpacity(0)
this.element.style.display="block";this.element.smoothOpacity(90);var scrollPosY=Constants.isIE?document.documentElement.scrollTop:window.pageYOffset;var scrollPosX=Constants.isIE?document.documentElement.scrollLeft:window.pageXOffset;this.element.style.left=ev.clientX-40+scrollPosX+"px";this.element.style.top=ev.clientY-this.element.clientHeight-10+scrollPosY+"px";tooltipActivated=this.element;var firingElement=Constants.isIE?ev.srcElement:ev.target;firingElement.onmouseout=function(ev){ev=ev||event;var firingElement=Constants.isIE?ev.srcElement:ev.target;if(firingElement!=tooltipActivated)tooltipActivated.CtrlClass().hide()}}
this.hide=function()
{this.element.smoothOpacity(0);}
this.WireUpAbilities=function()
{this.element.CtrlClass=function()
{return eval(this.getAttribute("EvaluationID"));}
this.element.setOpacity=function(opacity)
{this.style.filter="alpha(opacity:"+opacity+");";this.style.opacity=opacity/100;}
this.element.smoothOpacity=function(opacity,curOpacity)
{if(curOpacity==null)
{curOpacity=this.CtrlClass().opacity;if(this.fadeHandler!=null)
window.clearTimeout(this.fadeHandler);}
if(Math.abs(opacity-curOpacity)>this.CtrlClass().config['opacityChangeRatio'])
{var newOpacityGrade=curOpacity+(this.CtrlClass().config['opacityChangeRatio']*((opacity-curOpacity)/Math.abs(opacity-curOpacity)));this.setOpacity(newOpacityGrade);this.fadeHandler=window.setTimeout(this.getAttribute("EvaluationID")+".element.smoothOpacity("+opacity+", "+newOpacityGrade+")",10);}
else
{this.setOpacity(opacity);this.CtrlClass().opacity=opacity;if(opacity==0)
this.style.display="none";}}}
this.ctor(CSSClass,Text)}
function validateForm(element)
{var rtn=true;if(!element)
{element=window.document.forms[0]}
var MedixBoxes=element.getElementsByTagName('input');for(var i=MedixBoxes.length-1;i>=0;--i)
{if(MedixBoxes[i].getAttribute("skipValidation")=="true"){continue;}
if(MedixBoxes[i].className.indexOf('IWMedixBox')>-1)
{var f=MedixBoxes[i];if(f.getAttribute("EvaluationID")==null)
activateMedixBox(f)
if(!eval(f.getAttribute("EvaluationID")+".isValid()"))
rtn=false;}}
return rtn;}
function unValidateForm(element)
{var rtn=true;if(!element)
{element=window.document.forms[0]}
var MedixBoxes=element.getElementsByTagName('input');for(var i=MedixBoxes.length-1;i>=0;--i)
{if(MedixBoxes[i].getAttribute("skipValidation")=="true"){continue;}
if(MedixBoxes[i].className.indexOf('IWMedixBox')>-1)
{var f=MedixBoxes[i];if(f.getAttribute("EvaluationID")==null)
activateMedixBox(f)
eval(f.getAttribute("EvaluationID")+".markPassedValidation()")}}}
String.prototype.trim=function(){return this.replace(/^\s+|\s+$/,'');};MedixBoxesCollection=null;MedixBoxIdx=0;function activateMedixBox(IFelement)
{if(IFelement.className.indexOf("IWMedixBox")<0||IFelement.getAttribute("EvaluationID")!=null)
return;if(MedixBoxesCollection==null)
MedixBoxesCollection=new Array();MedixBoxesCollection[MedixBoxIdx]=new MedixBox("MedixBoxesCollection["+MedixBoxIdx+"]",IFelement);MedixBoxIdx++;}
function MedixBox(evalID,IFelement)
{this.isValid=function(doFocus){if(this.validateInput())
return true;window.setTimeout(this.getElementAttribute("EvaluationID")+".blinkErrMsg()",50);if(doFocus!=false)
this.element.focus();return false;}
this.blinkErrMsg=function()
{var errorSpan=document.getElementById(this.element.id+'ErrSpan');if(this.times>0)
{--this.times;if(errorSpan!=null)
{var curStatus=errorSpan.style.visibility;errorSpan.style.visibility=((curStatus=="visible")?"hidden":"visible");window.setTimeout(this.getElementAttribute("EvaluationID")+".blinkErrMsg()",100);}}
else
{this.times=this.getElementAttribute("blinkingTimes");if(errorSpan!=null)
errorSpan.style.visibility="visible";}}
this.doFormat=function()
{var FORMAT=this.getElementAttribute("format");if(this.element.value!=""&&FORMAT!=null&&FORMAT.toLowerCase().indexOf('commadelimiter')>-1)
{this.element.value=parseFloat(this.element.value.replace(new RegExp(/,/g),""));var idx=(this.element.value.lastIndexOf('.')>-1)?this.element.value.lastIndexOf('.'):this.element.value.length;for(var i=idx-1;i>0;--i)
{if(((i-idx)%3)==0)
this.element.value=this.element.value.substr(0,i)+","+this.element.value.substr(i,this.element.value.length);}}}
this.undoFormatting=function()
{var FORMAT=this.getElementAttribute("FORMAT");var rtn=this.element.value;if(FORMAT!=null&&FORMAT.toLowerCase().indexOf('commadelimiter')>-1)
rtn=this.element.value.replace(new RegExp(/,/g),"");return rtn;}
this.getElementAttribute=function(attName)
{return this.element.getAttribute(attName);}
this.setElementAttribute=function(attName,attValue)
{this.element.setAttribute(attName,attValue);}
this.initialize=function()
{if(this.getElementAttribute("allowed_chars")==null)
this.setElementAttribute("allowed_chars","");this.ALLOWED_CHARS=this.getElementAttribute("allowed_chars");if(this.getElementAttribute("accepts")!=null)
this.fillAllowedChars();if(this.getElementAttribute("blinkingTimes")==null)
this.setElementAttribute("blinkingTimes",0);this.times=this.getElementAttribute("blinkingTimes");this.element.attachEvent("onkeydown",this.onKeyDown);this.doFormat();this.handlePropertyChange();}
this.handlePropertyChange=function()
{var REQUIRED=this.getElementAttribute("required");if(REQUIRED!=null&&REQUIRED!=false&&this.element.className.toLowerCase().indexOf('required')<0)
{this.element.className+=" required";this.setElementAttribute("required","TRUE")}
if(this.getElementAttribute("readonly")==true&&this.element.className.toLowerCase().indexOf('readonly')<0)
{this.element.className+=" "+readonlycss;}}
this.handleErrorVisObjects=function(evl)
{var errObjClass=this.ErrorObjClass;if(this.ErrorObjClass!=null)
{var errObj=getElementsByCondition(function(el){return(el.className==errObjClass);},this.element.parentNode);for(var i=0;i<errObj.length;++i)
if(evl(errObj[i]))
{this.element.className=this.element.className.replace(' failedvalidation','');}
else
{this.element.className=this.element.className.replace(' failedvalidation','');this.element.className+=" failedvalidation";}}}
this.markFailedValidation=function(){this.handleErrorVisObjects(function(obj){obj.lastChild.nodeValue=obj.getAttribute("error0");obj.style.display="";return false});if(document.getElementById(this.element.id+'ErrSpan')!=null)
document.getElementById(this.element.id+'ErrSpan').style.visibility="visible";return false;}
this.markPassedValidation=function()
{this.handleErrorVisObjects(function(obj){obj.style.display="none";return true;});if(document.getElementById(this.element.id+'ErrSpan')!=null)
document.getElementById(this.element.id+'ErrSpan').style.visibility="hidden";return true;}
function f_add_digits(al_num){var ls_num=String(al_num);var ll_sum=0
for(var i=0;i<ls_num.length;i++){ll_sum+=parseInt(ls_num.substr(i,1));}
if(ll_sum>9){return f_add_digits(ll_sum);}
else{return ll_sum;}}
this.validateNumericRange=function(rawValue)
{var numericValue=parseInt(rawValue);maxValue=this.getElementAttribute("maxValue");minValue=this.getElementAttribute("minValue");return((maxValue==null||numericValue<=maxValue)&&(minValue==null||numericValue>=minValue));}
this.validateInput=function(){this.element.value=this.element.value.replace(/^\s+|\s+$/,'');this.markPassedValidation();if(this.element.disabled)
return true;if(this.element.value.length==0){if(this.getElementAttribute("required"))
return this.markFailedValidation();else
return true;}
var rawValue=this.undoFormatting();if(rawValue.length<this.getElementAttribute("MinLength")||!this.validateNumericRange(rawValue))
return this.markFailedValidation();VALIDATE=this.getElementAttribute("validate");VALIDATE=(VALIDATE!=null?VALIDATE.toLowerCase():"");if(VALIDATE=="email"){if(this.element.value.search(/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/)==-1)
return this.markFailedValidation();}
else
if(VALIDATE=="tznum"){var ll_sum=0;ls_num=this.element.value;ll_idnum=ls_num.substr(0,ls_num.length-1);ll_sb=ls_num.substr(ls_num.length-1);for(var i=0;i<(9-ls_num.length);i++){ll_idnum='0'+ll_idnum;}
for(var i=0;i<8;i++){ll_multi=i%2;ll_multi++;var ll_digit=f_add_digits(parseInt(ll_idnum.substr(i,1))*ll_multi);ll_sum+=ll_digit;}
ll_csb=10-(ll_sum%10);if(ll_csb==10)ll_csb=0;if(String(ll_csb)!=String(ll_sb))
return this.markFailedValidation();else
this.element.value=ll_idnum+ll_sb;}
else
if(VALIDATE=="date"){var dt=new Date(this.element.value);if(dt.toString()=='NaN')
return this.markFailedValidation();}
else
if(VALIDATE=="nickname"){if(this.element.value.indexOf(" ")>-1)
return this.markFailedValidation();}
else
if(VALIDATE.length!=0&&this.element.value.search(VALIDATE)==-1)
return this.markFailedValidation();return true;}
this.fillAllowedChars=function()
{var ACCEPTS=this.getElementAttribute("accepts").toLowerCase();if(ACCEPTS.indexOf('txt')>-1)
{this.rangedFill(32,126);this.rangedFill(1488,1514);this.ALLOWED_CHARS+=" ";}
if(ACCEPTS.indexOf('heb')>-1)
this.rangedFill(1488,1514);if(ACCEPTS.indexOf('eng')>-1)
{this.rangedFill(65,90);this.rangedFill(97,122);}
if(ACCEPTS.indexOf('num')>-1)
this.rangedFill(48,57);if(ACCEPTS.indexOf('sym')>-1)
{this.rangedFill(33,47);this.rangedFill(58,64);this.rangedFill(91,96);this.rangedFill(123,126);}
this.setElementAttribute("allowed_chars",this.ALLOWED_CHARS);}
this.rangedFill=function(from,to)
{for(var i=from;i<=to;++i)
{this.ALLOWED_CHARS+=String.fromCharCode(i);}}
charExist=function(chr,str)
{if(str==""||str==null)
return null;else
return(str.indexOf(chr)>-1);}
validateLength=function(keyCode)
{return true;}
this.doPaste=function()
{var maxAllowedLen=this.getElementAttribute("maxLength")-this.element.value.length;pastedStringBack=clipboardData.getData("Text");var index=0;var pastedString="";while(index<pastedStringBack.length&&pastedString.length<maxAllowedLen)
{var ch=pastedStringBack.charAt(index);if((charExist(ch,this.getElementAttribute("block_chars"))!=true&&charExist(ch,this.getElementAttribute("allowed_chars"))!=false))
pastedString+=ch;index++;}
clipboardData.setData("Text",pastedString);setTimeout(function(){clipboardData.setData('Text',pastedStringBack);},100);}
this.isIE=Constants.isIE;this.containerIDX=MedixBoxIdx;this.element=IFelement;this.element.setAttribute("EvaluationID",evalID);this.ALLOWED_CHARS="";this.times=7;this.ErrorObjClass=this.element.getAttribute("ErrObjClass")||"error";this.element.onkeypress=function(ev){if(ev==null)ev=event;var keyPressed=ev.charCode||ev.keyCode;if(ev.charCode!=0&&keyPressed!=13&&keyPressed!=16&&keyPressed!=0&&keyPressed!=27&&keyPressed!=8&&keyPressed!=9&&keyPressed!=25&&(keyPressed<63200||keyPressed>63300)){var blockedChars=this.getAttribute("block_chars");passedValidation=(charExist(String.fromCharCode(keyPressed),blockedChars==null?null:blockedChars)!=true&&charExist(String.fromCharCode(keyPressed),this.getAttribute("allowed_chars"))!=false);}
else
passedValidation=true;if(!passedValidation){if(!eval(this.getAttribute("EvaluationID")+".isIE")&&eval(this.getAttribute("EvaluationID")+".isIE")!=undefined)
ev.preventDefault();ev.returnValue=false;this.className+=" wrongKey";window.setTimeout(this.getAttribute("EvaluationID")+".element.className="+this.getAttribute("EvaluationID")+".element.className.replace(' wrongKey','')",100);}
return passedValidation;}
this.onKeyDown=function(ev)
{if(ev==null)ev=event;element=ev.srcElement;element.keyDown(ev);}
this.element.keyDown=function(ev)
{if(ev==null)ev=event;var keyPressed=ev.keyCode;if(keyPressed==13)
{eval(this.getAttribute("EvaluationID")+".doFormat()");if(this.getAttribute("nextField")!=null)
{if(eval(this.getAttribute("EvaluationID")+".validateInput()"))
{if(this.getAttribute("nextField").indexOf("javascript:")==0)
eval(this.getAttribute("nextField"));nextFieldName=this.getAttribute("nextField");if(document.getElementById(nextFieldName.value)!=null)
while(nextFieldName!=null&&document.getElementById(nextFieldName.value).disabled==true)
{nextFieldObj=document.getElementById(nextFieldName.value);if(nextField!=null)
nextFieldName=nextFieldObj.getAttribute("nextField");else
break;}
if(document.getElementById(nextFieldName.value)!=null)
document.getElementById(nextFieldName.value).focus();ev.returnValue=false;}}}}
this.element.onpaste=function()
{eval(this.getAttribute("EvaluationID")+".doPaste()")}
this.element.onfocus=function()
{this.select();}
this.element.CtrlClass=function()
{return eval(this.getAttribute("EvaluationID"));}
var _this_element_onchange=this.element.onchange;this.element.onchange=function()
{eval(this.getAttribute("EvaluationID")+".doFormat();");var sFuncTmp=getOriginalHandlerCommandScript(_this_element_onchange);if(sFuncTmp!="")eval(sFuncTmp);}
function getOriginalHandlerCommandScript(functionHandler){if(functionHandler!=null){var sFuncTmp=functionHandler+"";sFuncTmp=sFuncTmp.replace(/function[^\(]*\([^\)]*\)/,"");if(sFuncTmp!=""){return sFuncTmp;}}
return"";}
this.initialize();}
var statusTimeout;function ShowHideStatusDDL()
{var statusDDL=document.getElementById("statusDDL");if(statusDDL.style.display=="")
statusDDL.style.display="none";else
{statusDDL.style.display="";AutoCloseDDL(statusDDL);}}
function AutoCloseDDL(statusDDL)
{statusTimeout=setTimeout("document.getElementById('statusDDL').style.display = 'none'",3000);}
function openLogIn(successScript,optionalEmail){(pu_SignInDialog=new Popup("pu_SignInDialog","login.aspx",window,successScript)).show();if(optionalEmail!=null)
pu_SignInDialog.emailInput.value=optionalEmail;}
function openSignUp(successScript,optionalEmail)
{(pu_SignUpDialog=new Popup("pu_SignUpDialog","signup.aspx?d="+new Date().getTime(),window,successScript)).show();if(optionalEmail!=null)
pu_SignUpDialog.emailInput.value=optionalEmail;}
function SignOut()
{CIMMgr.chatBoxesExecuter(function(chtBx){chtBx.CtrlClass().closeDialog()});if(iMedix.Web.UsersManagement.UsersManagerInterface.SignOut().value)
return true;}
function InviteAFriend()
{(pu_InviteAFriend=new Popup('pu_InviteAFriend','InviteAFriend.aspx-',window)).show()}
function ImportContacts(){(pu_ImportContacts=new Popup('pu_ImportContacts','SecureFrame.aspx-',window,null,new Array("apps/ImportContactsDlg","Share iMedix with your loved ones"))).show()}
function InviteAFriendToBipolar()
{(pu_InviteAFriendToBipolar=new Popup('pu_InviteAFriendToBipolar','InviteAFriendToBipolar.aspx-',window)).show()}
function ReportAbusePU(abusingUserNickname,internalID,location)
{(pu_ReportInapprepriate=new Popup('pu_ReportInapprepriate','ReportInapprepriate.aspx',window,null,new Array(abusingUserNickname,internalID,location))).show();}
function BlockUser(BlockedUserName,domElm)
{(pu_BlockUser=new Popup("pu_BlockUser","BlockUser.aspx+",window,null,new Array(BlockedUserName))).show();domElm.innerHTML="Blocked!";domElm.onclick=function(){};}
function UnBlockUser(UnBlockedUserName,domElm,successScript)
{iMedix.Web.UsersManagement.UsersManagerInterface.RemoveFromBlockedList(UnBlockedUserName);LoadGeneralMessage("<b>"+UnBlockedUserName+" has been removed from your Blocked Users list. </b><br/><br/>You will now receive chats and private messages from "+UnBlockedUserName);domElm.innerHTML="Unblocked!";domElm.onclick=function(){};}
function AddToFriends(FriendName,SuccessScript)
{restrictedAccess("(pu_AddToFriends = new Popup(\"pu_AddToFriends\", \"FriendshipRequest.aspx+\", window, \""+SuccessScript+"\", new Array(\""+FriendName+"\"))).show()")}
function LoadGeneralMessage(message){var msg=iMedix.Web.Helpers.PopupHelper.GetHtmlContent("/pages/dialogs/ConfirmationMessage.aspx?m="+message);if(msg!=null&&msg.value.trim()!=""){var div=document.createElement("div");div.innerHTML=msg.value.trim();if(document.getElementById("msgDiv")){yellowMsg.removeChild(document.getElementById("msgDiv"));}
yellowMsg.appendChild(div.firstChild);}}
function showMessage(Msg,modal,param)
{(pu_GenMsgDiag=new Popup("pu_GenMsgDiag","generalmessage.aspx",modal||window,null,new Array(Msg,param||"true"))).show();}
function AddToFriendsSuccess(hrefId)
{var aObj=document.getElementById(hrefId);aObj.innerHTML="Pending friendship";aObj.onclick=function(){return false;};aObj.style.cursor="default";aObj.style.textDecoration="none";}
function AddToFriendsSuccess_FriendBox(hrefId)
{var aObj=document.getElementById(hrefId);aObj.title="Pending friendship";aObj.onclick=function(){return false;};aObj.style.cursor="default";aObj.style.textDecoration="none";}
function AcceptFriendshipRequest(RequesterName)
{iMedix.Web.UsersManagement.UsersManagerInterface.AcceptFriendshipRequest(RequesterName)}
function DeclineFriendshipRequest(RequesterName)
{iMedix.Web.UsersManagement.UsersManagerInterface.DeclineFriendshipRequest(RequesterName)}
function RemoveFriend(FriendName,aObj)
{if(confirm("Are you sure you want to remove "+FriendName+" from your friends list?"))
{iMedix.Web.UsersManagement.UsersManagerInterface.RemoveFromFriends(FriendName)
li=getParentElement(aObj,"li");li.parentNode.removeChild(li);}}
function refreshForNewUser(successScript,boolDoNotRefresh){try
{CIMMgr.chatBoxesExecuter(function(chtBx){chtBx.CtrlClass().closeDialog()});if(successScript!=null)
{if(successScript.substring(0,1)=="!")
{successScript=successScript.substring(1);boolDoNotRefresh=true;}
if(boolDoNotRefresh||successScript.indexOf("launchLink")>-1)
{Delete_Cookie('LoginEval','/','');eval(successScript);return;}
else
Set_Cookie('LoginEval',successScript,'0.1','/');}
else
if(boolDoNotRefresh)
return;}
catch(e){}
refresh();}
function ajaxProTimeoutManager(ms,req)
{if(req.context[3][1]!=null&&req.context[3][1].onTimeout!=null)
{return req.context[3][1].onTimeout();}
else
return false;}
function customizeAjaxProBehavior()
{AjaxPro.timeoutPeriod=10*1000;AjaxPro.onTimeout=ajaxProTimeoutManager;}
function recordStat()
{var statQuery="referrer="+encodeURIComponent(document.referrer)+"&url="+encodeURIComponent(window.location)+"&res="+screen.width+"x"+screen.height;iMedix.Web.GlobalAjaxFunctions.RecordPageStat(statQuery,recordStatDone);}
function recordStatDone()
{}
focusStack="";function addFocusQ(elem)
{focusStack+=elem.attributes["smartid"].value+";";}
function HandleInitialFocus()
{try{if(typeof(focusStack)==undefined||window.location.href.indexOf("#")>=0||GID==1)
return;focusableElements=focusStack.split(";");var selectedFocusElement=focusableElements[focusableElements.length-2];eval(selectedFocusElement+".focus()");}
catch(e)
{}}
function autoExec()
{try
{CIMMgr=new ClientIMManager();refreshForNewUser(Get_Cookie('LoginEval'),true);customizeAjaxProBehavior();wireSmartObjects();HandleInitialFocus()
recordStat();if(typeof(page_init)!="undefined")
{page_init();}
soundManager.onload=function(){soundManager.createSound('newChatMessage','/Media/Audio/New_Message.mp3');soundManager.createSound('bubblePop','/Media/Audio/bubble.mp3');}
var idx=window.location.href.indexOf("#")+1;if(idx==0)
return;var command=window.location.href.substr(idx).toLowerCase();var param=null;if(command.indexOf("=")>-1)
{frags=command.split("=");command=frags[0];param=frags[1];}
switch(command)
{case"signup":if(isGuest)
openSignUp(null,param);break;case"login":openLogIn(null,param);break;default:break;}}catch(e){if(Constants.Debug)
alert(Constants.isIE?e.message:e)}}
function initialize()
{if(arguments.callee.done)return;arguments.callee.done=true;Set_Cookie('CookieEnabled','none','','/','','');if(!Constants.Debug)
self.onerror=function(){return true;}
if(Get_Cookie('CookieEnabled'))
{Delete_Cookie('CookieEnabled','/','');autoExec();}
else
{if(Constants.Debug)
{displayCookieSupportMessage();return;}}
displayBrowserSupportMessage("if (typeof(handleSign)!='undefined') handleSign();");}
if(document.addEventListener){document.addEventListener("DOMContentLoaded",initialize,false);}
if(navigator.appName.toLowerCase().indexOf("explorer")>-1)
document.write("<script defer src=/ClientScripts/ie_onload.js><"+"/script>");window.onload=initialize;function displayCookieSupportMessage()
{var message="It appears that your browser does not support cookies, or that your browser cookies are disabled.<br/>Please enable cookies for full functionality.";(pu_CookieSupportDialog=new Popup("pu_CookieSupportDialog","generalmessage.aspx",null,null,new Array(message,"doNotAllowClosing"))).show();}
function displayBrowserSupportMessage(successScript)
{BrowserDetect.init();if(BrowserDetect.browser=="Safari"||BrowserDetect.browser=="Explorer"||BrowserDetect.browser=="Firefox"||Get_Cookie("BrowserSupportDisplayed"))
{return eval(successScript);}
if(BrowserDetect.browser=="Opera")
var message="We're sorry, at the moment we might not fully support the version of your browser. Complete support for "+BrowserDetect.browser+" will be available soon.<br/>In the meantime, please try using IE6 and up, or Firefox.";else
var message="We're sorry, at the moment we might not fully support the version of your browser.";Set_Cookie('BrowserSupportDisplayed','true','','/','','');}
function restrictedAccess(evaluationScript)
{try
{if(isGuest)
{KnownAsUser?openLogIn(evaluationScript):openSignUp(evaluationScript);}
else
{if(evaluationScript.substring(0,1)=="!")
evaluationScript=evaluationScript.substring(1);eval(evaluationScript);}}
catch(e){}
return false;}
function ShowRightBannerDiv(divObj,minWidth){screenW=screen.width;if(screenW>minWidth)
divObj.style.display="";}
ClientIMManager=function(){this.evalID="CIMMgr";this.NumberOfOpenedPanels=0;this.PanelCollection=new Array();this.scrollHandler=null;this.CurrentIMStatus=CurrentAvailabilityStatus;this.chatDisplayStatus={Minimized:0,Maximized:1};this.notifierHandler=null;this.focusIdx=0;this.ctor=function(){if(!isGuest)
window.setTimeout(this.evalID+".fetchMessages()",5000)
if(BrowserDetect.browser=="Firefox"){HTMLElement.prototype.click=function(){var evt=this.ownerDocument.createEvent('MouseEvents');evt.initMouseEvent('click',true,true,this.ownerDocument.defaultView,1,0,0,0,0,false,false,false,false,0,null);this.dispatchEvent(evt);}}
if(typeof(chatInitialization)!="undefined"){window.setTimeout(chatInitialization+"CIMMgr.arrangeChatBoxes();",100);}
Delete_Cookie('ChatBoxesSettings','/','');}
this.setUserStatusCB=function(res){var status=res.value;if(status!=null){var newStatusClass="";var statusDDL=document.getElementById("statusDDL");var UserStatusDiv=document.getElementById("UserStatusDiv");currentHref=UserStatusDiv.getElementsByTagName("a")[0];switch(status){case 0:newStatusClass="Online";break;case 1:newStatusClass="Offline";break;case 2:newStatusClass="Invisible";break;default:newStatusClass="Offline";break;}
currentHref.innerHTML=newStatusClass;currentHref.className=newStatusClass.toLowerCase();statusDDL.style.display="none";CIMMgr.CurrentIMStatus=status;CIMMgr.chatBoxesExecuter(function(chtBx){chtBx.CtrlClass().handleStatuses()});}}
this.ignore=function(user){iMedix.Web.InstantMessaging.InstantMessagingInterface.ignore(user);}
this.accept=function(user,cid){iMedix.Web.InstantMessaging.InstantMessagingInterface.accept(user,cid);}
this.registerChatBox=function(chatBox){this.NumberOfOpenedPanels++;}
this.setUserStatus=function(status){iMedix.Web.InstantMessaging.InstantMessagingInterface.setStatus(status,CIMMgr.setUserStatusCB);CIMMgr.CurrentIMStatus="wait";CIMMgr.chatBoxesExecuter(function(chtBx){chtBx.CtrlClass().handleStatuses()});}
this.initiateChat=function(userName,conversationID,alsoFocus){var alsoFocus=(alsoFocus==null)?true:alsoFocus;if(CIMMgr.PanelCollection[userName]==null){conversationID=conversationID==null?"":conversationID;(CIMMgr.PanelCollection[userName]=new Popup("CIMMgr.PanelCollection['"+userName+"']","chatdialog.aspx-",window,null,new Array(userName,conversationID.toString()))).show();}
else{if(conversationID!=null){CIMMgr.PanelCollection[userName].ConversationID=conversationID;}}
if(alsoFocus){CIMMgr.PanelCollection[userName].focus();CIMMgr.PanelCollection[userName].setInputFocus();}}
this.onTimeout=function(){this.fetchMessages();return true;}
this.fetchMessages=function(){try{var ConversationIDs=new Array();CIMMgr.chatBoxesExecuter(function(chtBx){ConversationIDs[ConversationIDs.length]=chtBx.CtrlClass().ConversationID});iMedix.Web.InstantMessaging.InstantMessagingInterface.IMFetchMessages(ConversationIDs,this.fetchMessagesCB,this);}
catch(e){window.setTimeout(this.evalID+".fetchMessages()",10000)}}
this.fetchMessagesCB=function(res){if(res!=null&&res.value!=null){CIMMgr.onMessage(res.value.messages);if(res.value.fetchNextIn>0)
window.setTimeout("CIMMgr.fetchMessages()",res.value.fetchNextIn);}
else{window.setTimeout("CIMMgr.fetchMessages()",10000);}}
this.onMessage=function(messages){if(messages!=null){for(var i=0;i<messages.length;++i){var partner=(messages[i].transportType==0)?messages[i].from:messages[i].to;if(messages[i].body.indexOf(messages[i].nickname+" is typing...")<0){CIMMgr.initiateChat(partner,messages[i].conversationID,false);}
if(!isNullOrUndefined(CIMMgr.PanelCollection[partner])){if(isNullOrUndefined(CIMMgr.PanelCollection[partner].StartTime)||CIMMgr.PanelCollection[partner].StartTime=="0")
CIMMgr.PanelCollection[partner].StartTime=messages[i].dateTime;CIMMgr.PanelCollection[partner].renderMessage(messages[i]);}}}}
this.sendMessage=function(to,msg,convID,myNick){iMedix.Web.InstantMessaging.InstantMessagingInterface.IMSendMessage(to,msg,convID,CIMMgr.onSendMessage);CIMMgr.PanelCollection[to].renderMessage({transportType:1,to:to,conversationID:convID,type:0,nickname:myNick,body:escapeHTML(msg)});}
this.sendKeyBord=function(to,msg,convID,myNick){iMedix.Web.InstantMessaging.InstantMessagingInterface.IMSendKeyBord(to,msg,convID,CIMMgr.onSendMessage);CIMMgr.PanelCollection[to].renderMessage({transportType:1,to:to,conversationID:convID,type:1,nickname:myNick,body:escapeHTML(msg)});}
this.onSendMessage=function(res){}
this.chatBoxesExecuter=function(func,boolJustOnce){chatPanels=getElementsByCondition(function(el){return(el.getAttribute('EvaluationID')!=null&&el.getAttribute('EvaluationID').indexOf("CIMMgr.PanelCollection[")>-1);});for(var i=0;i<chatPanels.length;++i){if(func(chatPanels[i])&&boolJustOnce)
break;}}
this.arrangeChatBoxes=function(ev){if(CIMMgr.NumberOfOpenedPanels>0){var chatPanels=getElementsByCondition(function(el){return(el.getAttribute('EvaluationID')!=null&&el.getAttribute('EvaluationID').indexOf("CIMMgr.PanelCollection[")>-1);});var dockIdx=0;for(var i=0;i<chatPanels.length;++i){var elm=chatPanels[i].CtrlClass();if(elm.currentStatus==CIMMgr.chatDisplayStatus.Minimized&&elm.isDocked){elm.dockTo(dockIdx++);}}}}
this.stopNotifyMessage=function(){if(CIMMgr.notifierHandler!=null){window.clearInterval(CIMMgr.notifierHandler);CIMMgr.notifierHandler=null;document.title=CIMMgr.OriginalTitle;}}
this.notifyMessage=function(){if(CIMMgr.notifierHandler!=null)
return;if(typeof(CIMMgr.OriginalTitle)=="undefined"){CIMMgr.OriginalTitle=document.title;CIMMgr.NotifyingTitle="* New chat message *";}
CIMMgr.notifierHandler=window.setInterval("document.title=document.title==CIMMgr.NotifyingTitle ? CIMMgr.OriginalTitle : CIMMgr.NotifyingTitle;",1000);}
this.serializeChatBox=function(chatBox){var chatBoxSetting=chatBox.CtrlClass().me+"|"+chatBox.CtrlClass().evalID+"=style:\"top:"+chatBox.CtrlClass().currentTopPos+"px; left:"+chatBox.CtrlClass().currentLeftPos+"px; z-index:2; position:absolute;\",class:\""+chatBox.className+"\",conversationID:\""+chatBox.CtrlClass().ConversationID+"\",startTime:\""+chatBox.CtrlClass().StartTime+"\",dateLiteral:\""+escape(chatBox.CtrlClass().dateLiteral.innerHTML)+"\"";if(chatBox.CtrlClass().isDocked)
chatBoxSetting+=",isDocked:\"true\",origLeftPos:\""+chatBox.CtrlClass().origLeftPos+"\",origTopPos:\""+chatBox.CtrlClass().origTopPos+"\"&";else
chatBoxSetting+=",isDocked:\"false\",origLeftPos:\"0\",origTopPos:\"0\"&";chatBoxesSettings+=chatBoxSetting;}
this.showIncomingMessage=function(){CIMMgr.chatBoxesExecuter(function(chtBx){if(chtBx.CtrlClass().notificationHandler!=null){chtBx.CtrlClass().focus();chtBx.CtrlClass().goMax();return true};return false},true);return false;}
this.cycleChatBoxes=function(keyPressed){if(CIMMgr.NumberOfOpenedPanels>0){if(typeof(cyclePanels)=="undefined"){cyclePanels=getElementsByCondition(function(el){return(el.getAttribute('EvaluationID')!=null&&el.getAttribute('EvaluationID').indexOf("CIMMgr.PanelCollection[")>-1);});}
else{cyclePanels[CIMMgr.focusIdx].CtrlClass().goMin();}
CIMMgr.focusIdx+=(keyPressed==60)?-1:1;if(cyclePanels.length==CIMMgr.focusIdx){cyclePanels=getElementsByCondition(function(el){return(el.getAttribute('EvaluationID')!=null&&el.getAttribute('EvaluationID').indexOf("CIMMgr.PanelCollection[")>-1);});CIMMgr.focusIdx=0;}
else
if(CIMMgr.focusIdx<0){cyclePanels=getElementsByCondition(function(el){return(el.getAttribute('EvaluationID')!=null&&el.getAttribute('EvaluationID').indexOf("CIMMgr.PanelCollection[")>-1);});CIMMgr.focusIdx=0;}
cyclePanels[CIMMgr.focusIdx].CtrlClass().focus()
cyclePanels[CIMMgr.focusIdx].CtrlClass().goMax();}
return false;}
this.keyPressHandler=function(ev){var keyPressed=Constants.isIE?ev.keyCode:ev.charCode;if(ev.ctrlKey&&keyPressed==(Constants.isIE?29:93)){return this.showIncomingMessage();}
if(ev.shiftKey&&(keyPressed==60||keyPressed==62)){return this.cycleChatBoxes(keyPressed)}}
window.onfocus=function(ev){ev=(ev==null)?event:ev;try{CIMMgr.stopNotifyMessage();}catch(e){}}
window.onclick=function(ev){ev=(ev==null)?event:ev;try{window.onfocus(ev);}catch(e){}}
window.onresize=function(ev){ev=(ev==null)?event:ev;try{CIMMgr.arrangeChatBoxes();}
catch(e){}}
document.onkeypress=function(ev){ev=(ev==null)?event:ev;try{return CIMMgr.keyPressHandler(ev);}
catch(e){return false;}}
window.onbeforeunload=function(evt){try{if(CIMMgr.CurrentIMStatus==0&&CIMMgr.NumberOfOpenedPanels>0){chatBoxesSettings="";CIMMgr.chatBoxesExecuter(CIMMgr.serializeChatBox);Set_Cookie('ChatBoxesSettings',chatBoxesSettings,'0.1','/');}
else
Delete_Cookie('ChatBoxesSettings','/','');}
catch(e){Delete_Cookie('ChatBoxesSettings','/','');}}
this.ctor();}
var GetNewMessagesInterval=window.setInterval(function(){if(window.location.href.toLowerCase().indexOf("inbox")==-1)
GetNewMessagesCount();},60*1000)
function GetNewMessagesCount()
{}
function SendPMMessage(userName)
{restrictedAccess('launchLink("/myimedix/inbox?compose='+userName+'")');}
function ShowPMInbox()
{restrictedAccess('launchLink("/myimedix/inbox")');}if(typeof(Constants)=="undefined")
Constants=new Object();Constants.isIE=navigator.appName.toLowerCase().indexOf("explorer")>-1;Constants.ajaxImageL=new Image();Constants.ajaxImageS=new Image();Constants.Timeout=Constants.Debug?1700:0;Constants.CurrentURL="";if(Constants.isIE){document.onclick=function(){return handleStat()}}
else{document.onclick=function(event){return handleStat(event)}}
function handleStat(e){e=e||event;var obj=e.srcElement||e.target;var sid=obj.getAttribute("sid");if(isNullOrUndefined(sid)){obj=obj.parentNode;if(obj)
sid=obj.getAttribute("sid");if(isNullOrUndefined(sid))
return;}
var sai=obj.getAttribute("sai");if(notNullOrUndefined(sai)&&sai.indexOf("eval:")==0)
sai=eval(sai.substring("eval:".length));if(!Constants.isIE&&e.which==3)
return true;stat(sid,sai);if(obj.nodeName.toLowerCase()!="a")
return true;if(obj.nodeName.toLowerCase()=="a"&&notNullOrUndefined(obj.getAttribute("target")))
return true;if(!Constants.isIE&&e.which>=2)
return true;if(e.ctrlKey||e.altKey)
return true;try
{if(obj.href.toLowerCase().startsWith("javascript:"))
{href=obj.href.replace("javascript:","").replaceAll("'","\\'");window.setTimeout("eval('"+href+"'); href=null; ",100);return false;}
if(!obj.href.endsWith("/#"))
{href=obj.href.replace("'","\\'");window.setTimeout("launchLink('"+href+"'); href=null; ",100);return false;}}
catch(e){return true;}}
var href;function setOnloadEvent(func){if(navigator.appName=="Microsoft Internet Explorer")
window.attachEvent('onload',func);else{window.addEventListener('load',func,false);}}
var Error={};Error.Report=function(str,e){if(Constants.Debug)
alert(str+"\n Exception: "+e)}
if(Constants.Debug)
{Debug={};Debug.handleObject=function(){if(typeof(this.obj)=="undefined"){document.body.appendChild(this.obj=document.createElement("div"));this.obj.style.position="fixed";this.obj.style.top=this.obj.style.left="0px"};return this.obj;}
Debug.Append=function(){for(var i=0;i<arguments.length;++i)this.handleObject().innerHTML+="&lt;"+i+":"+arguments[i]+"&gt; ";}
Debug.Write=function(){this.Clean();Debug.Append(arguments);}
Debug.Clean=function(str){if(this.obj!=null)this.obj.innerHTML="";}}
Constants.ajaxImageL.src="/media/images/general/ajax-loader-LARGE.gif";Constants.ajaxImageS.src="/media/images/general/ajax-loader-SMALL.gif";isDescendant=function(element,ancestor)
{if(ancestor==element)
return true;for(var n=element.parentNode;n!=null;n=n.parentNode){if(n==ancestor)return true;}
return false;}
String.prototype.stripSpaces=function(){return this.replace(/\s/g,"").replace(/&nbsp;/g,"");};String.prototype.endsWith=function(str){return this.trim().toLowerCase().lastIndexOf(str)==this.trim().length-str.length;}
String.prototype.removeIfEndsWith=function(str){if(this.endsWith(str))
return this.trim().substring(0,this.trim().length-str.length);else
return this;}
String.prototype.startsWith=function(str){return this.trim().toLowerCase().indexOf(str.toLowerCase())==0;}
String.prototype.removeIfStartsWith=function(str){if(this.startsWith(str))
return this.substring(str.length);else
return this;}
String.prototype.LTrim=function(){var re=/\s*((\S+\s*)*)/;return this.replace(re,"$1");}
String.prototype.RTrim=function(){var re=/((\s*\S+)*)\s*/;return this.replace(re,"$1");}
String.prototype.trim=function(){return this.replace(/^\s{1,}/ig,"").replace(/\s{1,}$/ig,"");}
String.prototype.Format=function(str1,str2){str1=str1||null;str2=str2||null;return this.replace("{0}",str1).replace("{1}",str2);}
String.prototype.replaceAll=function(s1,s2){return this.replace(new RegExp(s1,"g"),s2);}
String.format=function()
{if(arguments.length==0)
return null;var str=arguments[0];for(var i=1;i<arguments.length;i++)
{var re=new RegExp('\\{'+(i-1)+'\\}','gm');str=str.replace(re,arguments[i]);}
return str;}
function loadModule(url)
{var res=iMedix.Web.Helpers.PopupHelper.GetHtmlContent(url);if(res.value==null)
return;var tempObj=document.createElement("div");tempObj.innerHTML=res.value
wireSmartObjects(tempObj);eval(getSingleElementByCondition(function(elm){return elm.tagName=="SCRIPT";},tempObj).innerHTML)
return getSingleElementByCondition(function(elm){return elm.tagName=="DIV";},tempObj);}
function launchLink(url,newWindow,newWindowParams)
{var submitAnchor=document.createElement("a");submitAnchor.href=url;document.body.appendChild(submitAnchor);if(newWindowParams==undefined)
newWindowParams='';if(newWindow)
{window.open(url,"Imedix",newWindowParams);return;}
if(Constants.isIE)
submitAnchor.click();else
location.href=url;}
function Get_Cookie(check_name){var a_all_cookies=document.cookie.split(';');var a_temp_cookie='';var cookie_name='';var cookie_value='';var b_cookie_found=false;for(i=0;i<a_all_cookies.length;i++)
{a_temp_cookie=a_all_cookies[i].split('=');cookie_name=a_temp_cookie[0].replace(/^\s+|\s+$/g,'');if(cookie_name==check_name)
{b_cookie_found=true;cookie_value=unescape(a_temp_cookie[1].replace(/^\s+|\s+$/g,''));return cookie_value;break;}
a_temp_cookie=null;cookie_name='';}
if(!b_cookie_found)
{return null;}}
function Set_Cookie(name,value,expires,path,domain,secure){var today=new Date();today.setTime(today.getTime());if(expires)
{expires=expires*1000*60;}
var expires_date=new Date(today.getTime()+(expires));document.cookie=name+"="+escape(value)+
((expires)?";expires="+expires_date.toGMTString():"")+
((path)?";path="+path:"")+
((domain)?";domain="+domain:"")+
((secure)?";secure":"");}
function Delete_Cookie(name,path,domain){if(Get_Cookie(name))document.cookie=name+"="+
((path)?";path="+path:"")+
((domain)?";domain="+domain:"")+";expires=Thu, 01-Jan-1970 00:00:01 GMT";}
function QSObject(querystring){var qsReg=new RegExp("[?][^#]*","i");hRef=unescape(querystring);var qsMatch=hRef.match(qsReg);qsMatch=new String(qsMatch);qsMatch=qsMatch.substr(1,qsMatch.length-1);var rootArr=qsMatch.split("&");for(i=0;i<rootArr.length;i++){var tempArr=rootArr[i].split("=");if(tempArr.length==2){tempArr[0]=unescape(tempArr[0]);tempArr[1]=unescape(tempArr[1]);this[tempArr[0]]=tempArr[1];this["#"+i]=tempArr[0]+"="+tempArr[1];}
this.length=rootArr.length;}}
function getElementByTagAndId(tagName,id,obj)
{obj=obj||document;objs=obj.getElementsByTagName(tagName);for(i=0;i<objs.length;i++)
{if(objs[i].id.toLowerCase().indexOf(id.toLowerCase())!=-1)
return objs[i];}
return obj;}
var _LastStatDate=new Date().getTime();function stat(statTypeID,aInfo)
{aInfo=aInfo||"";var diff=new Date();var sec=0;try{diff.setTime(Math.abs(_LastStatDate-new Date().getTime()));sec=(diff/1000);if(parseFloat(sec)>1){window.setTimeout(function(){iMedix.Web.GlobalAjaxFunctions.CreateElementStat(statTypeID,window.location.href,aInfo,statCB);},0);}
_LastStatDate=new Date().getTime();}
catch(e){}}
function statCB(){}
function createLargeAjaxImage(objectToPutIn,emptyTheOriginalContent)
{emptyTheOriginalContent=emptyTheOriginalContent||false;imgObj=document.createElement("IMG");imgObj.src=Constants.ajaxImageL.src;if(emptyTheOriginalContent)
objectToPutIn.innerHTML="";return objectToPutIn.appendChild(imgObj);}
function removeAjaxImage(imgObj)
{imgObj.parentNode.removeChild(imgObj);}
function getParentElement(startingObject,elementTagName,cType)
{obj=startingObject.parentNode;if(isNullOrUndefined(obj))
return null;if(obj.nodeName==elementTagName.toUpperCase())
{if(notNullOrUndefined(cType))
{if(notNullOrUndefined(obj.getAttribute("cType")))
{if(obj.getAttribute("cType")==cType)
return obj
else
return getParentElement(obj,elementTagName,cType)}
else
return getParentElement(obj,elementTagName,cType)}
else
return obj}
else
{if(obj.nodeName!="BODY")
return getParentElement(obj,elementTagName,cType)}}
function getTextFromNode(node)
{if(Constants.isIE)
return node.text
else if(!Constants.isIE)
return node.childNodes[0].nodeValue}
function isNullOrUndefined(obj)
{try
{return((obj==null)||(obj=="")||(obj==undefined)||(typeof(obj)=="undefined"));}
catch(e)
{return true;}}
function notNullOrUndefined(obj)
{return!isNullOrUndefined(obj)}
function nvl(strObj,alternate)
{if(isNullOrUndefined(strObj))
return alternate
else
return strObj}
function returnAttr(attribute,value1,value2){if(attribute.indexOf(value1)!=-1)
return attribute.replace(value1,value2);else
return attribute.replace(value2,value1);}
function fillZero(num,rLength)
{num=num.toString();var s="";for(i=0;i<rLength-num.length;i++)
s+="0"
return s+num;}
function mousePos(e){var pos={x:0,y:0}
e=e||event;if(!document.all){pos.x=e.pageX;pos.y=e.pageY;}
else
{pos.x=e.clientX+document.body.scrollLeft;pos.y=e.clientY+document.body.scrollTop;}
x=pos.x;y=pos.y;return pos;}
function refresh(param){param=param||null;if(param==null)
{ind=window.location.href.toLowerCase().indexOf("#");if(ind==-1){launchLink(window.location.href);}
else{launchLink(window.location.href.substring(0,ind));}}
else{ind=window.location.href.toLowerCase().indexOf(param.toLowerCase())
if(ind==-1){launchLink(window.location.href)}
else{launchLink(window.location.href.substring(0,ind-1));}}}
function FillStates(CountryID)
{iMedix.Web.UsersManagement.UsersManagerInterface.fillStatesDdlByCountryID(CountryID,FillStatesCB);}
function FillStatesCB(res)
{try{var ddlStates=stateid==undefined?document.getElementById(ddlStatesID):stateid;ddlStates.length=0;if(res.value.Rows.length==0)
ddlStates.disabled=true;else
{ddlStates.disabled=false;for(i=0;i<res.value.Rows.length;i++)
{var opt=document.createElement("OPTION");opt.text=res.value.Rows[i]["StateName"];opt.value=res.value.Rows[i]["StateID"];ddlStates.options.add(opt);}}}
catch(e)
{ddlStates.disabled=true;}}
function HandleIMStatusMenu(obj)
{statusesObj=getParentElement(obj,"div").getElementsByTagName("DIV")[0];var statuses=statusesObj.getElementsByTagName("a");for(var i=0;i<statuses.length;++i)
{statuses[i].style.display=(statuses[i].innerHTML==obj.innerHTML)?"none":"";}
if(statusesObj.style.display=="none")
statusesObj.style.display=""
else
statusesObj.style.display="none"
DelayClosingMenu();}
var DelayClosingMenuID=null;function DelayClosingMenu()
{if(DelayClosingMenuID!=null)
window.clearTimeout(DelayClosingMenuID);DelayClosingMenuID=window.setTimeout(function(){document.getElementById("statusSelect").style.display="none";},1500)}
function enterPressed(e)
{return Constants.isIE?e.keyCode==13:e.which==13;}
function hideSelectBoxes()
{var selectBoxes=document.getElementsByTagName("SELECT")
for(i=0;i<selectBoxes.length;i++)
selectBoxes[i].style.visibility="hidden";}
function showSelectBoxes()
{var selectBoxes=document.getElementsByTagName("SELECT")
for(i=0;i<selectBoxes.length;i++)
selectBoxes[i].style.visibility="visible";}
function resetForm(containerObj,startIndex)
{startIndex=startIndex||0;var inputs=containerObj.getElementsByTagName("INPUT")
for(var i=startIndex;i<inputs.length;i++)
{if(inputs[i].type.toLowerCase()=="text"||inputs[i].type.toLowerCase()=="password")
inputs[i].value="";}
unValidateForm(containerObj);}
function addCommas(nStr)
{nStr+='';x=nStr.split('.');x1=x[0];x2=x.length>1?'.'+x[1]:'';var rgx=/(\d+)(\d{3})/;while(rgx.test(x1)){x1=x1.replace(rgx,'$1'+','+'$2');}
return x1+x2;}
function smartSubmission(formAction,method,containerElement,disabledFormFields)
{containerElement=containerElement||document.body;var smartFormObjs=getElementsByCondition(function(el){return((el.tagName=="TEXTAREA"||el.tagName=="SELECT"||el.tagName=="INPUT")&&el.getAttribute("smartid")!=null);},containerElement);var IsFieldDisable=false;var disabledFieldsArr="";if(disabledFormFields!=undefined){disabledFieldsArr=disabledFormFields.split(",");}
var newForm=document.createElement("form");newForm.action=formAction;newForm.method=method;for(var ei=0;ei<smartFormObjs.length;++ei)
{var inpElm=document.createElement("input");if((smartFormObjs[ei].type=="radio"&&!smartFormObjs[ei].checked)||smartFormObjs[ei].value.trim()==""||(smartFormObjs[ei].value=="-1"&&smartFormObjs[ei].tagName=="SELECT"))
continue;inpElm.name=smartFormObjs[ei].getAttribute("smartid").toLowerCase();inpElm.value=smartFormObjs[ei].value.toLowerCase();if(disabledFieldsArr!=""){for(i=0;i<=disabledFieldsArr.length-1;i++){if(disabledFieldsArr[i]==inpElm.name){IsFieldDisable=true;break;}}}
if(!IsFieldDisable)
newForm.appendChild(inpElm);IsFieldDisable=false;}
document.body.appendChild(newForm);newForm.submit();}
function wireSmartObjects(container){container=(container==null?this.element:container)
var smartObj=getElementsByCondition(function(el){return(el.getAttribute("smartid")!=null);},container);for(var i=0;i<smartObj.length;++i)
{eval("this."+smartObj[i].getAttribute("smartid")+"=smartObj[i]");}
for(var i=0;i<smartObj.length;++i)
{if(smartObj[i].getAttribute("smartinit")!=null)
{var s_this=smartObj[i];eval(smartObj[i].getAttribute("smartinit"));}}}
function EmptyTable(tblObj)
{for(var i=tblObj.rows.length;i>0;i--)
tblObj.deleteRow(i-1)}
function getElementsByCondition(condition,container)
{container=container||document
var all=container.all||container.getElementsByTagName('*')
var arr=[]
for(var k=0;k<all.length;k++)
{var elm=all[k]
if(elm.nodeType!=1)
continue;if(condition(elm,k)){arr[arr.length]=elm}}
return arr}
function getSingleElementByCondition(condition,container)
{container=container||document
var all=container.all||container.getElementsByTagName('*')
for(var k=0;k<all.length;k++){var elm=all[k]
if(elm.nodeType!=1)
continue;if(condition(elm,k))
return elm;}
return null;}
function dateFormat(dateObj,sec)
{sec=sec||false;var FullMonths=new Array("January","February","March","April","May","June","July","August","September","October","November","December");var Months=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sept","Oct","Nov","Dec");var d=dateObj;return timeFormat(dateObj,sec)+" on "+d.getDate()+" "+Months[d.getMonth()]+", "+d.getFullYear();}
function timeFormat(dateObj,sec)
{sec=sec||false;var d=dateObj;var Hour=d.getHours();var Minute=fillZero(d.getMinutes(),2)
var AmPm="AM";if(Hour==0||Hour>12)
{AmPm="PM";Hour=Math.abs(Hour-12);}
return Hour+":"+Minute+(sec?(":"+fillZero(d.getSeconds(),2)):"")+" "+AmPm;}
function loadClientScript(src){var html_doc=document.getElementsByTagName('head').item(0);var js=document.createElement('script');js.setAttribute('language','javascript');js.setAttribute('type','text/javascript');js.setAttribute('src',(src.indexOf("http://")==0?src:"/ClientScripts/"+src));html_doc.appendChild(js);}
function loadCSS(href,targetWindow){var targetWindow=targetWindow||window;var html_doc=targetWindow.document.getElementsByTagName('head').item(0);var js=document.createElement('link');js.setAttribute('href',Constants.ExternalURL+"/Styles/"+href);js.setAttribute('rel','Stylesheet');js.setAttribute('type','text/css');html_doc.appendChild(js);}
var BrowserDetect={init:function(){this.browser=this.searchString(this.dataBrowser)||"An unknown browser";this.version=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion)||"an unknown version";this.OS=this.searchString(this.dataOS)||"an unknown OS";},searchString:function(data){for(var i=0;i<data.length;i++){var dataString=data[i].string;var dataProp=data[i].prop;this.versionSearchString=data[i].versionSearch||data[i].identity;if(dataString){if(dataString.indexOf(data[i].subString)!=-1)
return data[i].identity;}
else if(dataProp)
return data[i].identity;}},searchVersion:function(dataString){var index=dataString.indexOf(this.versionSearchString);if(index==-1)return;return parseFloat(dataString.substring(index+this.versionSearchString.length+1));},dataBrowser:[{string:navigator.userAgent,subString:"OmniWeb",versionSearch:"OmniWeb/",identity:"OmniWeb"},{string:navigator.vendor,subString:"Apple",identity:"Safari"},{prop:window.opera,identity:"Opera"},{string:navigator.vendor,subString:"iCab",identity:"iCab"},{string:navigator.vendor,subString:"KDE",identity:"Konqueror"},{string:navigator.userAgent,subString:"Firefox",identity:"Firefox"},{string:navigator.vendor,subString:"Camino",identity:"Camino"},{string:navigator.userAgent,subString:"Netscape",identity:"Netscape"},{string:navigator.userAgent,subString:"MSIE",identity:"Explorer",versionSearch:"MSIE"},{string:navigator.userAgent,subString:"Gecko",identity:"Mozilla",versionSearch:"rv"},{string:navigator.userAgent,subString:"Mozilla",identity:"Netscape",versionSearch:"Mozilla"}],dataOS:[{string:navigator.platform,subString:"Win",identity:"Windows"},{string:navigator.platform,subString:"Mac",identity:"Mac"},{string:navigator.platform,subString:"Linux",identity:"Linux"}]};function applyFormDiscardingProtection(discardMessage)
{resetFormProtection=function()
{document.getElementsByTagName('form')[0].setAttribute('changed','0');return true;}
canSubmit=function()
{return applyFormDiscardingProtection.submissionEnabled;}
enableSubmission=function()
{applyFormDiscardingProtection.submissionEnabled=true;var submitButtons=getElementsByCondition(function(el){return(el.getAttribute('onclick')!=null&&(el.getAttribute('onclick').toString()).indexOf("validateForm")>-1);});for(var i=0;i<submitButtons.length;++i)
{submitButtons[i].className="save"}}
disableSubmission=function()
{applyFormDiscardingProtection.submissionEnabled=false;var submitButtons=getElementsByCondition(function(el){return(el.getAttribute('onclick')!=null&&(el.getAttribute('onclick').toString()).indexOf("validateForm")>-1);});for(var i=0;i<submitButtons.length;++i)
{submitButtons[i].className="saveD"}}
setFormChanged=function()
{if(document.getElementsByTagName('form')[0].getAttribute('changed')!='1')
{document.getElementsByTagName('form')[0].setAttribute('changed','1');var submitButtons=getElementsByCondition(function(el){return(el.getAttribute('onclick')!=null&&(el.getAttribute('onclick').toString()).indexOf("validateForm")>-1);});for(var i=0;i<submitButtons.length;++i)
{submitButtons[i].className="save"}}}
undoNotify=function(ev)
{var ev=ev!=null?ev:event;if(document.getElementsByTagName('form')[0].getAttribute('changed')=='1')
{ev.returnValue=applyFormDiscardingProtection.msg;return applyFormDiscardingProtection.msg;}}
if(navigator.appName=="Microsoft Internet Explorer")
window.attachEvent('onbeforeunload',undoNotify);else{window.addEventListener('beforeunload',undoNotify,false);}
this.submissionEnabled=true;this.msg=discardMessage;}
function countWords(str)
{return str.split(" ").length;}
function escapeHTML(str)
{var div=document.createElement('div');var text=document.createTextNode(str.replace(/[\n\r]+/g,"<br/>"));div.appendChild(text);return div.innerHTML.replaceAll('&lt;br/&gt;','<br/>');}
function unescapeHTML(str){var div=document.createElement('div');div.innerHTML=str;return div.childNodes[0]?(div.childNodes.length>1?$A(div.childNodes).inject('',function(memo,node){return memo+node.nodeValue}):div.childNodes[0].nodeValue):'';}
function addInterest(objContainer)
{if(objContainer.getElementsByTagName('span').length<1)
{objContainer.style.display="block";objContainer.innerHTML="Your topics of interest already include this tag";}
else
{objContainer.style.display="block";var tag=objContainer.getElementsByTagName('span')[0].innerHTML;iMedix.Web.GlobalAjaxFunctions.AddInterest(tag,addInterestCB);objContainer.innerHTML="Your topics of interest were updated";}
objContainer.style.fontWeight="bold";objContainer.style.textDecoration="none";objContainer.onclick=function(){return false;};objContainer.style.cursor="default";}
function activateObjects()
{objects=document.getElementsByTagName("embed");for(var i=0;i<objects.length;i++)
{objects[i].outerHTML=objects[i].outerHTML;}}
function addInterestCB(res)
{}
function HandleTagLinks(aObj,tagName)
{}
function BookmarkPage(url,title)
{url=isNullOrUndefined(url)?window.location.href:url;title=isNullOrUndefined(title)?window.document.title:title;if(window.sidebar){window.sidebar.addPanel(title,url,"");}else if(window.external){window.external.AddFavorite(url,title);}
else if(window.opera&&window.print){return true;}}
function RemoveOpenLineTextFromHtmlObj(obj,textToRemove){if(obj==undefined)
return;if(obj.value==undefined||obj.value=="")
return;if(textToRemove==undefined||textToRemove=="")
return;if(obj.value==textToRemove)
obj.value="";}
function RestoreOpenLineTextToHtmlObj(obj,textToInsert){if(obj==undefined)
return;if(textToInsert==undefined||textToInsert=="")
return;if(obj.value=="")
obj.value=textToInsert;else
return;}
function ReplaceUrlsWithHtmlAnchors(StringValue){var strContent=StringValue;var urlregex=new RegExp("(http:\/\/([\\w.]+\/?)\\S*)","gi");strContent=strContent.replace(urlregex,"<a href='$1' target='_blank'>$1</a>");return strContent;}
function printStackTrace(){var callstack=[];var currentFunction=arguments.callee.caller;while(currentFunction){var fn=currentFunction.toString();var fname=fn.substring(fn.indexOf("function")+8,fn.indexOf("("))||"anonymous";callstack.push(fname);currentFunction=currentFunction.caller;}
return callstack.join("(..)<--");}
Selection=function(inputObj,selectionObj)
{this.handlePanel=function(selectionObj)
{this.panel=selectionObj;this.panel.selector=this;this.panel.style.height="1px";this.panel.setOpacity=function(opacity)
{this.style.filter="alpha(opacity:"+opacity+");";this.style.opacity=opacity/100;}}
this.resize=function()
{this.openPanel();}
this.openPanel=function()
{if(this.panel.isOpened)
return;if(this.openHandler==null)
this.panel.className=this.panel.className+" on";var delta=0
if(Math.abs(delta)>1)
{var oldHeight=this.panel.clientHeight;this.panel.style.height=parseInt(this.panel.style.height,10)+delta*0.5+"px";if(delta<0||this.panel.clientHeight!=oldHeight)
{this.openHandler=window.setTimeout(this.element.smartid+".selector.openPanel()",1);return;}}
this.openHandler=null;this.panel.style.height=this.panel.getElementsByTagName("LI").length*20+"px";this.panel.isOpened=true;}
this.closePanel=function()
{if(this.openHandler!=null)
{window.clearTimeout(this.openHandler);this.openHandler=null;}
if(this.panel==null||!this.panel.isOpened)
return;var delta=10-this.panel.clientHeight;if(Math.abs(delta)>1)
{this.panel.style.height=parseInt(this.panel.style.height,10)+delta*0.5+"px";this.closeHandler=window.setTimeout(this.element.smartid+".selector.closePanel()",10);}
else
{this.panel.style.height="1px";this.panel.className=this.panel.className.replace(" on","");this.closeHandler=null;this.panel.isOpened=false;}}
this.keySensitiveRender=function(delayInMs)
{var delay=delayInMs||200;this.cancelShow();if(this.element.value!="")
this.showTime=window.setTimeout(this.element.smartid+".selector.refreshAutoComplete()",delay);else
this.closePanel();}
this.moveUp=function()
{if(this.currentHover==null)
{this.panel.lastChild.className="on";this.currentHover=this.panel.lastChild;}
else
{var newHover=(this.currentHover==this.panel.firstChild?this.panel.lastChild:this.currentHover.previousSibling)
this.currentHover.className="";newHover.className="on";this.currentHover=newHover;}
this.showCurrentHover();}
this.moveDown=function()
{if(this.currentHover==null)
{this.panel.firstChild.className="on";this.currentHover=this.panel.firstChild;}
else
{var newHover=(this.currentHover==this.panel.lastChild?this.panel.firstChild:this.currentHover.nextSibling)
this.currentHover.className="";newHover.className="on";this.currentHover=newHover;}
this.showCurrentHover();}
this.showCurrentHover=function()
{if(this.currentHover.offsetTop<this.panel.scrollTop)
{this.panel.scrollTop=this.currentHover.offsetTop;}
else
{if(this.currentHover.offsetTop+this.currentHover.offsetHeight>this.panel.scrollTop+this.panel.offsetHeight)
{this.panel.scrollTop=this.currentHover.offsetTop+this.currentHover.offsetHeight;}}}
this.cancelEvent=function(ev)
{ev.returnValue=false;ev.cancelBubble=true;if(ev.stopPropagation)
ev.stopPropagation();}
this.onKeyPress=function(ev)
{switch(ev.keyCode)
{case 40:(this.panel&&this.panel.isOpened)?this.moveDown():this.keySensitiveRender(0);break;case 38:(this.panel&&this.panel.isOpened)?this.moveUp():this.keySensitiveRender(0);break;case 13:return true;case 27:this.closePanel();return true;default:this.keySensitiveRender();return true;}
this.setValue(false);this.cancelEvent(ev);return false;}
this.cancelShow=function()
{if(this.showTime!=null)
{window.clearTimeout(this.showTime)
this.showTime=null;}}
this.onLostFocus=function(ev)
{this.closeASPanel=window.setTimeout(this.element.smartid+".selector.cancelShow();"+this.element.smartid+".selector.closePanel()",100);}
this.onFocus=function(ev)
{if(this.closeASPanel!=null)
{window.clearTimeout(this.closeASPanel)
this.closeASPanel=null;}}
this.onKeyDown=function(ev)
{switch(ev.keyCode)
{case 13:this.setValue();return true;default:return true;}
this.cancelEvent(ev);}
this.onFilterKeyPress=function(ev)
{if(ev.shiftKey)
return;switch(ev.keyCode)
{case 40:break;case 38:break;default:return true;}
this.cancelEvent(ev);}
this.onClick=function(ev)
{if(this.panel.isOpened)
this.closePanel();else
this.openPanel();}
this.keyPressed=function(ev)
{var ev=ev||event;var element=ev.srcElement;return element.selector.onKeyPress(ev);}
this.keyDown=function(ev)
{var ev=ev||event;var element=ev.srcElement;return element.selector.onKeyDown(ev);}
this.filterkeyPress=function(ev)
{var ev=ev||event;var element=ev.srcElement;return element.selector.onFilterKeyPress(ev);}
this.lostFocus=function(ev)
{var ev=ev||event;var element=ev.srcElement;return element.selector.onLostFocus(ev);}
this.Focus=function(ev)
{var ev=ev||event;var element=ev.srcElement;return element.selector.onFocus(ev);}
this.suggestionHover=function(ev)
{var ev=ev||event;var element=ev.srcElement;return(ev.srcElement.tagName=="P")?element.selector.setHover(element):null;}
this.ExitHover=function(ev)
{var ev=ev||event;var element=ev.srcElement;if(element.selector==null||element.tagName!="DIV")
return;Debug.Append(element.tagName)
return}
this.Click=function(ev)
{var ev=ev||event;var element=ev.srcElement;return element.selector.onClick(ev);}
this.DocClick=function(ev)
{if(Selection.panel.isOpened)
Selection.closePanel();}
this.init=function(inputObj,selectionObj)
{this.element=inputObj;this.smartid=this.element.smartid=this.element.getAttribute("smartid");this.element.selector=this;document.body.attachEvent("onmousedown",this.DocClick);this.handlePanel(selectionObj);this.element.attachEvent("onclick",this.Click);}
this.init(inputObj,selectionObj);}
function RestoreDefaultStyle(txtArea){txtArea.style.color="#000000";txtArea.style.fontStyle="normal";}
function RestoreBlureStyle(txtArea){if(txtArea.value!=""){RestoreDefaultStyle(txtArea);return;}
txtArea.style.color="gray";txtArea.style.fontStyle="italic";CalcCharsLeft('Type your health question...');}
function CalcCharsLeft(onStartText){if(onStartText==inpQuestion.value)
lblCharacters.innerHTML=Number(inpQuestion.getAttribute('maxlength'));else
lblCharacters.innerHTML=Number(inpQuestion.getAttribute('maxlength'))-inpQuestion.value.length;}
function checkContent(txtArea,txtValue){if(txtArea.value!=txtValue)
RestoreDefaultStyle(txtArea);else{txtArea.style.color="gray";txtArea.style.fontStyle="italic";}}
function InitAskBoxFxForAjaxPages(){wireSmartObjects(document.getElementById("askContainer"));inpQuestion=Question;if(Question.value=='')
AskGuide.style.display='block';Question.onblur=function(){if(Question.value=='')AskGuide.style.display='block';}
CalcCharsLeft('Type your health question');}
Suggester=function(inputObj,styleClass,SugUrl,separator)
{this.refreshAutoComplete=function()
{this.showTime=null;if(this.panel==null)
this.handlePanel();if(this.element.value=="")
this.closePanel();else
{this.SugFunc.Suggest(this.getValue(),this.renderSuggestions,this);}}
this.renderSuggestions=function(suggestions)
{context=suggestions.context;context.resetNav();if(suggestions.value==null||context.element.value=="")
{context.closePanel();return;}
context.panel.style.overflowY="hidden";context.panel.innerHTML="";for(var i=0;i<suggestions.value.length;++i)
{var sug=document.createElement("p");sug.suggester=context;sug.attachEvent("onmousedown",context.suggestionClick);sug.attachEvent("onmousemove",context.suggestionHover);sug.value=suggestions.value[i].SuggestionValue;context.panel.appendChild(sug);switch(suggestions.value[i].type)
{case 1:sug.style.borderBottom="dashed 1px gray";sug.innerHTML="<span class='dym'><cite><<< Spelling suggestion</cite>"+suggestions.value[i].SuggestionDisplayName+"</span>";break;default:sug.innerHTML=suggestions.value[i].SuggestionDisplayName;break;}}
context.resize();}
this.setValue=function(doNotClose)
{if(this.currentHover!=null)
{var left=this.getLeftSep();var right=this.getRightSep();this.element.value=this.element.value.substring(0,left)+this.currentHover.value+this.element.value.substring(right);this.setElementSelectionStart(left+this.currentHover.value.length);}
if(doNotClose==null||doNotClose!=false)
{this.currentHover=null;this.closePanel();}}
this.getLeftSep=function()
{var inpValue=this.element.value;var left=this.getElementSelectionStart();left=left<0?0:left;while(left>0&&inpValue.charAt(left-1)!=this.separator)
--left;return left;}
this.getRightSep=function()
{var inpValue=this.element.value;var right=this.getElementSelectionStart();while(right<inpValue.length&&inpValue.charAt(right)!=this.separator)
++right;return right;}
this.getValue=function()
{var inpValue=this.element.value;return inpValue.substring(this.getLeftSep(),this.getRightSep()).trim();}
this.setHover=function(obj)
{if(this.currentHover!=null)
this.currentHover.className="";this.currentHover=obj;this.currentHover.className="on";}
this.handlePanel=function()
{if(this.panel==null)
{this.panel=document.createElement("div");this.panel.className="AutoSuggest "+this.styleClass;this.panel.style.width=this.element.clientWidth+"px";this.panel.style.height="10px";this.panel.style.display="none";this.panel.attachEvent("onfocus",this.Focus);this.panel.attachEvent("onkeyup",this.keyPressed);this.panel.attachEvent("onkeypress",this.filterkeyPress);this.panel.attachEvent("onblur",this.lostFocus);if(typeof(BrowserDetect)!="undefined"&&((BrowserDetect.browser=="Explorer"&&BrowserDetect.version==7)||(BrowserDetect.browser=="Firefox")||(BrowserDetect.browser=="Opera")))
{this.panel.style.maxHeight="200px"}
this.panel.suggester=this;this.bgFrame=document.createElement("iframe");this.bgFrame.style.display="none";this.bgFrame.style.position="absolute";this.bgFrame.style.backgroundColor="white";this.bgFrame.frameBorder="0";this.bgFrame.style.width=this.element.clientWidth+"px";this.bgFrame.zIndex=0;document.body.appendChild(this.panel);document.body.appendChild(this.bgFrame);}}
this.resize=function()
{this.openPanel();}
this.openPanel=function()
{if(this.panel.childNodes.length==0)
{this.closePanel();return;}
if(this.showHandler!=null)
{window.clearTimeout(this.showHandler);this.showHandler=null;}
if(this.panel.style.display=="none")
{var left=0;oNode=this.element;while(oNode!=null){left+=oNode.offsetLeft;oNode=oNode.offsetParent;}
var top=0;oNode=this.element;while(oNode!=null){top+=oNode.offsetTop;oNode=oNode.offsetParent;}
this.panel.style.left=left+"px";this.panel.style.top=-4+this.element.offsetHeight+top+"px";this.panel.style.display="";this.bgFrame.style.display="";this.bgFrame.style.top=parseInt(this.panel.style.top,10)+2+"px";this.bgFrame.style.left=this.panel.style.left;}
var delta=2+this.panel.lastChild.offsetTop+this.panel.lastChild.offsetHeight-this.panel.clientHeight;if(Math.abs(delta)>3)
{var oldHeight=this.panel.clientHeight;this.panel.style.height=parseInt(this.panel.style.height,10)+delta*0.2+"px";this.bgFrame.style.height=this.panel.clientHeight+"px";if(delta<0||this.panel.clientHeight!=oldHeight)
{this.showHandler=window.setTimeout(this.element.smartid+".suggester.openPanel()",10);return;}}
this.showHandler=null;this.panel.style.height=2+this.panel.lastChild.offsetTop+this.panel.lastChild.offsetHeight+"px";this.panel.style.overflowY="auto";this.panel.style.overflow="auto";this.panel.style.overflowX="hidden";if(this.panel.scrollTop!=0)
this.panel.scrollTop=0;this.bgFrame.style.height=this.panel.clientHeight+"px";this.panel.isOpened=true;}
this.closePanel=function()
{if(this.showHandler!=null)
{window.clearTimeout(this.showHandler);this.showHandler=null;}
if(this.panel==null||this.panel.isOpened==false)
return;if(this.panel.style.overflowY!="hidden")
this.panel.style.overflowY="hidden";var delta=10-this.panel.clientHeight;if(Math.abs(delta)>3)
{this.panel.style.height=parseInt(this.panel.style.height,10)+delta*0.2+"px";this.bgFrame.style.height=this.panel.style.height;this.showHandler=window.setTimeout(this.element.smartid+".suggester.closePanel()",10);}
else
{this.showHandler=null;this.panel.style.display="none";this.bgFrame.style.display="none";this.panel.isOpened=false;this.panel.innerHTML="";}}
this.keySensitiveRender=function(delayInMs)
{var delay=delayInMs||200;this.cancelShow();if(this.element.value!="")
this.showTime=window.setTimeout(this.element.smartid+".suggester.refreshAutoComplete()",delay);else
this.closePanel();}
this.moveUp=function()
{if(this.currentHover==null)
{this.panel.lastChild.className="on";this.currentHover=this.panel.lastChild;}
else
{var newHover=(this.currentHover==this.panel.firstChild?this.panel.lastChild:this.currentHover.previousSibling)
this.currentHover.className="";newHover.className="on";this.currentHover=newHover;}
this.showCurrentHover();}
this.moveDown=function()
{if(this.currentHover==null)
{this.panel.firstChild.className="on";this.currentHover=this.panel.firstChild;}
else
{var newHover=(this.currentHover==this.panel.lastChild?this.panel.firstChild:this.currentHover.nextSibling)
this.currentHover.className="";newHover.className="on";this.currentHover=newHover;}
this.showCurrentHover();}
this.showCurrentHover=function()
{if(this.currentHover.offsetTop<this.panel.scrollTop)
{this.panel.scrollTop=this.currentHover.offsetTop;}
else
{if(this.currentHover.offsetTop+this.currentHover.offsetHeight>this.panel.scrollTop+this.panel.offsetHeight)
{this.panel.scrollTop=this.currentHover.offsetTop+this.currentHover.offsetHeight;}}}
this.resetNav=function()
{if(this.currentHover!=null)
{this.currentHover.className="";this.currentHover=null;}}
this.cancelEvent=function(ev)
{ev.returnValue=false;ev.cancelBubble=true;if(ev.stopPropagation)
ev.stopPropagation();}
this.onKeyPress=function(ev)
{switch(ev.keyCode)
{case 40:(this.panel&&this.panel.isOpened)?this.moveDown():this.keySensitiveRender(0);break;case 38:(this.panel&&this.panel.isOpened)?this.moveUp():this.keySensitiveRender(0);break;case 13:return true;case 27:this.closePanel();return true;default:this.keySensitiveRender();return true;}
this.setValue(false);this.cancelEvent(ev);return false;}
this.cancelShow=function()
{if(this.showTime!=null)
{window.clearTimeout(this.showTime)
this.showTime=null;}}
this.onLostFocus=function(ev)
{this.closeASPanel=window.setTimeout(this.element.smartid+".suggester.cancelShow();"+this.element.smartid+".suggester.closePanel()",100);}
this.onFocus=function(ev)
{if(this.closeASPanel!=null)
{window.clearTimeout(this.closeASPanel)
this.closeASPanel=null;}}
this.setElementSelectionStart=function(pos)
{if(this.element.createTextRange)
{this.element.focus();var r=document.selection.createRange();r.moveStart('character',-this.element.value.length+pos);r.moveEnd('character',-this.element.value.length+pos)
r.select();}
else
{this.element.selectionStart=pos;this.element.selectionEnd=pos;}}
this.getElementSelectionStart=function()
{if(this.element.createTextRange)
{var r=document.selection.createRange().duplicate()
r.moveEnd('character',this.element.value.length)
if(r.text=='')return this.element.value.length
return this.element.value.lastIndexOf(r.text)}
else
return this.element.selectionStart}
this.onKeyDown=function(ev)
{switch(ev.keyCode)
{case 13:this.setValue();return true;default:return true;}
this.cancelEvent(ev);}
this.onFilterKeyPress=function(ev)
{if(ev.shiftKey)
return;switch(ev.keyCode)
{case 40:break;case 38:break;default:return true;}
this.cancelEvent(ev);}
this.onClick=function(ev)
{if(ev.srcElement==this.element)
this.keySensitiveRender(2000);}
this.keyPressed=function(ev)
{var ev=ev||event;var element=ev.srcElement;return element.suggester.onKeyPress(ev);}
this.keyDown=function(ev)
{var ev=ev||event;var element=ev.srcElement;return element.suggester.onKeyDown(ev);}
this.filterkeyPress=function(ev)
{var ev=ev||event;var element=ev.srcElement;return element.suggester.onFilterKeyPress(ev);}
this.lostFocus=function(ev)
{var ev=ev||event;var element=ev.srcElement;return element.suggester.onLostFocus(ev);}
this.Focus=function(ev)
{var ev=ev||event;var element=ev.srcElement;return element.suggester.onFocus(ev);}
this.suggestionHover=function(ev)
{var ev=ev||event;var element=ev.srcElement;return(ev.srcElement.tagName=="P")?element.suggester.setHover(element):null;}
getParentElementNode=function(startingObject,elementTagName)
{obj=startingObject.parentNode;if(obj==null)
return null;if(obj.nodeName==elementTagName.toUpperCase())
{return obj;}
else
{if(obj.nodeName!="BODY")
return getParentElementNode(obj,elementTagName)}}
this.suggestionClick=function(ev)
{var ev=ev||event;var element=ev.srcElement;var rtn=null;try{rtn=element.suggester!=null?element.suggester.setValue():getParentElementNode(element,"p").suggester.setValue();}catch(e){alert(e)}
return rtn;}
this.Click=function(ev)
{var ev=ev||event;var element=ev.srcElement;return element.suggester.onClick(ev);}
this.init=function(inputObj,styleClass,SugFunc,separator)
{this.element=inputObj;this.styleClass=styleClass;this.SugFunc=SugFunc;this.element.smartid=this.element.getAttribute("smartid");this.separator=separator;if(Constants.isIE)
try{if(inputObj.className.indexOf("IWMedixBox")>-1)activateMedixBox(inputObj);}catch(e){}
inputObj.attachEvent("onblur",this.lostFocus);inputObj.attachEvent("onclick",this.Click);inputObj.attachEvent("onfocus",this.Focus);inputObj.attachEvent("onkeyup",this.keyPressed);inputObj.attachEvent("onkeypress",this.filterkeyPress);inputObj.attachEvent("onkeydown",this.keyDown);}
this.init(inputObj,styleClass,SugUrl,separator);}
try
{var isIE=(window.navigator.userAgent.indexOf("MSIE")>0);if(!isIE){HTMLElement.prototype.__defineGetter__("innerText",function(){return(this.textContent);});HTMLElement.prototype.__defineSetter__("innerText",function(txt){this.textContent=txt;});HTMLElement.prototype.__defineGetter__("children",function(){return(this.childNodes);});HTMLElement.prototype.__defineGetter__("XMLDocument",function(){return((new DOMParser()).parseFromString(this.innerHTML,"text/xml"));});HTMLElement.prototype.attachEvent=function(eventName,fHandler){fHandler._wrapHandler=function(e){window.event=e;fHandler();return(e.returnValue);};this.addEventListener(eventName.substr(2),fHandler._wrapHandler,false);};HTMLElement.prototype.detachEvent=function(eventName,fHandler){if(fHandler._wrapHandler!=null)
this.removeEventListener(eventName.substr(2),fHandler._wrapHandler,false);};Event.prototype.__defineGetter__("srcElement",function(){var node=this.target;while(node.nodeType!=1)node=node.parentNode;if(node!=this.target)alert("Unexpected event.target!")
return node;});Event.prototype.__defineSetter__("cancelBubble",function(b){if(b)this.stopPropagation();});Event.prototype.__defineSetter__("returnValue",function(b){if(!b)this.preventDefault();this._returnValue=b;return(b);});Event.prototype.__defineGetter__("returnValue",function(){return(this._returnValue);});XMLDocument.prototype.selectSingleNode=function(xPath){var doc=this;if(doc.nodeType!=9)
doc=doc.ownerDocument;if(doc.nsResolver==null)doc.nsResolver=function(prefix){return(null);};var node=doc.evaluate(xPath,this,doc.nsResolver,XPathResult.ANY_UNORDERED_NODE_TYPE,null);if(node!=null)node=node.singleNodeValue;return(node);};Node.prototype.__defineGetter__("text",function(){return(this.textContent);});}}
catch(e)
{}
function SoundManager(smURL,smID){var self=this;this.version='V2.0b.20070415';this.url=(smURL||'/Media/Flash/soundmanager2.swf');this.debugMode=false;this.useConsole=true;this.consoleOnly=false;this.nullURL='data/null.mp3';this.defaultOptions={'autoLoad':false,'stream':true,'autoPlay':false,'onid3':null,'onload':null,'whileloading':null,'onplay':null,'whileplaying':null,'onstop':null,'onfinish':null,'onbeforefinish':null,'onbeforefinishtime':5000,'onbeforefinishcomplete':null,'onjustbeforefinish':null,'onjustbeforefinishtime':200,'multiShot':true,'pan':0,'volume':100}
this.allowPolling=true;this.enabled=false;this.o=null;this.id=(smID||'sm2movie');this.oMC=null;this.sounds=[];this.soundIDs=[];this.isIE=(navigator.userAgent.match(/MSIE/));this.isSafari=(navigator.userAgent.match(/safari/i));this.debugID='soundmanager-debug';this._debugOpen=true;this._didAppend=false;this._appendSuccess=false;this._didInit=false;this._disabled=false;this._hasConsole=(typeof console!='undefined'&&typeof console.log!='undefined');this._debugLevels=!self.isSafari?['debug','info','warn','error']:['log','log','log','log'];this.getMovie=function(smID){return self.isIE?window[smID]:(self.isSafari?document[smID+'-embed']:document.getElementById(smID+'-embed'));}
this.loadFromXML=function(sXmlUrl){try{self.o._loadFromXML(sXmlUrl);}catch(e){self._failSafely();return true;}}
this.createSound=function(oOptions){if(!self._didInit)throw new Error('soundManager.createSound(): Not loaded yet - wait for soundManager.onload() before calling sound-related methods');if(arguments.length==2){oOptions={'id':arguments[0],'url':arguments[1]}}
var thisOptions=self._mergeObjects(oOptions);self._writeDebug('soundManager.createSound(): "<a href="#" onclick="soundManager.play(\''+thisOptions.id+'\');return false" title="play this sound">'+thisOptions.id+'</a>" ('+thisOptions.url+')',1);if(self._idCheck(thisOptions.id,true)){self._writeDebug('sound '+thisOptions.id+' already defined - exiting',2);return false;}
self.sounds[thisOptions.id]=new SMSound(self,thisOptions);self.soundIDs[self.soundIDs.length]=thisOptions.id;try{self.o._createSound(thisOptions.id,thisOptions.onjustbeforefinishtime);}catch(e){self._failSafely();return true;}
if(thisOptions.autoLoad||thisOptions.autoPlay)self.sounds[thisOptions.id].load(thisOptions);if(thisOptions.autoPlay)self.sounds[thisOptions.id].playState=1;}
this.destroySound=function(sID){if(!self._idCheck(sID))return false;for(var i=self.soundIDs.length;i--;){if(self.soundIDs[i]==sID){delete self.soundIDs[i];continue;}}
self.sounds[sID].unload();delete self.sounds[sID];}
this.load=function(sID,oOptions){if(!self._idCheck(sID))return false;self.sounds[sID].load(oOptions);}
this.unload=function(sID){if(!self._idCheck(sID))return false;self.sounds[sID].unload();}
this.play=function(sID,oOptions){if(!self._idCheck(sID)){if(typeof oOptions!='Object')oOptions={url:oOptions};if(oOptions&&oOptions.url){self._writeDebug('soundController.play(): attempting to create "'+sID+'"',1);oOptions.id=sID;self.createSound(oOptions);}else{return false;}}
self.sounds[sID].play(oOptions);}
this.start=this.play;this.setPosition=function(sID,nMsecOffset){if(!self._idCheck(sID))return false;self.sounds[sID].setPosition(nMsecOffset);}
this.stop=function(sID){if(!self._idCheck(sID))return false;self._writeDebug('soundManager.stop('+sID+')',1);self.sounds[sID].stop();}
this.stopAll=function(){self._writeDebug('soundManager.stopAll()',1);for(var oSound in self.sounds){if(self.sounds[oSound]instanceof SMSound)self.sounds[oSound].stop();}}
this.pause=function(sID){if(!self._idCheck(sID))return false;self.sounds[sID].pause();}
this.resume=function(sID){if(!self._idCheck(sID))return false;self.sounds[sID].resume();}
this.togglePause=function(sID){if(!self._idCheck(sID))return false;self.sounds[sID].togglePause();}
this.setPan=function(sID,nPan){if(!self._idCheck(sID))return false;self.sounds[sID].setPan(nPan);}
this.setVolume=function(sID,nVol){if(!self._idCheck(sID))return false;self.sounds[sID].setVolume(nVol);}
this.setPolling=function(bPolling){if(!self.o||!self.allowPolling)return false;self._writeDebug('soundManager.setPolling('+bPolling+')');self.o._setPolling(bPolling);}
this.disable=function(){if(self._disabled)return false;self._disabled=true;self._writeDebug('soundManager.disable(): Disabling all functions - future calls will return false.',1);for(var i=self.soundIDs.length;i--;){self._disableObject(self.sounds[self.soundIDs[i]]);}
self.initComplete();self._disableObject(self);}
this.getSoundById=function(sID,suppressDebug){if(!sID)throw new Error('SoundManager.getSoundById(): sID is null/undefined');var result=self.sounds[sID];if(!result&&!suppressDebug){self._writeDebug('"'+sID+'" is an invalid sound ID.',2);}
return result;}
this.onload=function(){soundManager._writeDebug('<em>Warning</em>: soundManager.onload() is undefined.',2);}
this.onerror=function(){}
this._idCheck=this.getSoundById;this._disableObject=function(o){for(var oProp in o){if(typeof o[oProp]=='function'&&typeof o[oProp]._protected=='undefined')o[oProp]=function(){return false;}}
oProp=null;}
this._failSafely=function(){var flashCPLink='http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html';var fpgssTitle='You may need to whitelist this location/domain eg. file:///C:/ or C:/ or mysite.com, or set ALWAYS ALLOW under the Flash Player Global Security Settings page. Note that this seems to apply only to file system viewing.';var flashCPL='<a href="'+flashCPLink+'" title="'+fpgssTitle+'">view/edit</a>';var FPGSS='<a href="'+flashCPLink+'" title="Flash Player Global Security Settings">FPGSS</a>';if(!self._disabled){self._writeDebug('soundManager: JS-&gt;Flash communication failed. Possible causes: flash/browser security restrictions ('+flashCPL+'), insufficient browser/plugin support, or .swf not found',2);self._writeDebug('Verify that the movie path of <em>'+self.url+'</em> is correct (<a href="'+self.url+'" title="If you get a 404/not found, fix it!">test link</a>)',1);if(self._didAppend){if(!document.domain){self._writeDebug('Loading from local file system? (document.domain appears to be null, this URL path may need to be added to \'trusted locations\' in '+FPGSS+')',1);self._writeDebug('Possible security/domain restrictions ('+flashCPL+'), should work when served by http on same domain',1);}}
self.disable();}}
this._createMovie=function(smID,smURL){if(self._didAppend&&self._appendSuccess)return false;if(window.location.href.indexOf('debug=1')+1)self.debugMode=true;self._didAppend=true;var html=['<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="16" height="16" id="'+smID+'"><param name="movie" value="'+smURL+'"><param name="quality" value="high"><param name="allowScriptAccess" value="always" /></object>','<embed name="'+smID+'-embed" id="'+smID+'-embed" src="'+smURL+'" width="1" height="1" quality="high" allowScriptAccess="always" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed>'];var toggleElement='<div id="'+self.debugID+'-toggle" style="position:fixed;_position:absolute;right:0px;bottom:0px;_top:0px;width:1.2em;height:1.2em;line-height:1.2em;margin:2px;padding:0px;text-align:center;border:1px solid #999;cursor:pointer;background:#fff;color:#333;z-index:706" title="Toggle SM2 debug console" onclick="soundManager._toggleDebug()">-</div>';var debugHTML='<div id="'+self.debugID+'" style="display:'+(self.debugMode&&((!self._hasConsole||!self.useConsole)||(self.useConsole&&self._hasConsole&&!self.consoleOnly))?'block':'none')+';opacity:0.85"></div>';var appXHTML='soundManager._createMovie(): appendChild/innerHTML set failed. Serving application/xhtml+xml MIME type? Browser may be enforcing strict rules, not allowing write to innerHTML. (PS: If so, this means your commitment to XML validation is going to break stuff now, because this part isn\'t finished yet. ;))';var sHTML='<div style="position:absolute;left:-256px;top:-256px;width:1px;height:1px" class="movieContainer">'+html[self.isIE?0:1]+'</div>'+(self.debugMode&&((!self._hasConsole||!self.useConsole)||(self.useConsole&&self._hasConsole&&!self.consoleOnly))&&!document.getElementById(self.debugID)?'x'+debugHTML+toggleElement:'');var oTarget=(document.body?document.body:document.getElementsByTagName('div')[0]);if(oTarget){self.oMC=document.createElement('div');self.oMC.className='movieContainer';self.oMC.style.position='absolute';self.oMC.style.left='-256px';self.oMC.style.width='1px';self.oMC.style.height='1px';try{oTarget.appendChild(self.oMC);self.oMC.innerHTML=html[self.isIE?0:1];self._appendSuccess=true;}catch(e){throw new Error(appXHTML);}
if(!document.getElementById(self.debugID)&&((!self._hasConsole||!self.useConsole)||(self.useConsole&&self._hasConsole&&!self.consoleOnly))){var oDebug=document.createElement('div');oDebug.id=self.debugID;oDebug.style.display=(self.debugMode?'block':'none');if(self.debugMode){try{var oD=document.createElement('div');oTarget.appendChild(oD);oD.innerHTML=toggleElement;}catch(e){throw new Error(appXHTML);}}
oTarget.appendChild(oDebug);}
oTarget=null;}
self._writeDebug('-- SoundManager 2 Version '+self.version.substr(1)+' --',1);self._writeDebug('soundManager._createMovie(): trying to load <a href="'+smURL+'" title="Test this link (404=bad)">'+smURL+'</a>',1);}
this._writeDebug=function(sText,sType){if(!self.debugMode)return false;if(self._hasConsole&&self.useConsole){console[self._debugLevels[sType]||'log'](sText);if(self.useConsoleOnly)return true;}
var sDID='soundmanager-debug';try{var o=document.getElementById(sDID);if(!o)return false;var p=document.createElement('div');p.innerHTML=sText;o.insertBefore(p,o.firstChild);}catch(e){}
o=null;}
this._writeDebug._protected=true;this._writeDebugAlert=function(sText){alert(sText);}
if(window.location.href.indexOf('debug=alert')+1){self.debugMode=true;self._writeDebug=self._writeDebugAlert;}
this._toggleDebug=function(){var o=document.getElementById(self.debugID);var oT=document.getElementById(self.debugID+'-toggle');if(!o)return false;if(self._debugOpen){oT.innerHTML='+';o.style.display='none';}else{oT.innerHTML='-';o.style.display='block';}
self._debugOpen=!self._debugOpen;}
this._toggleDebug._protected=true;this._debug=function(){self._writeDebug('soundManager._debug(): sounds by id/url:',0);for(var i=0,j=self.soundIDs.length;i<j;i++){self._writeDebug(self.sounds[self.soundIDs[i]].sID+' | '+self.sounds[self.soundIDs[i]].url,0);}}
this._mergeObjects=function(oMain,oAdd){var o1=oMain;var o2=(typeof oAdd=='undefined'?self.defaultOptions:oAdd);for(var o in o2){if(typeof o1[o]=='undefined')o1[o]=o2[o];}
return o1;}
this.createMovie=function(sURL){if(sURL)self.url=sURL;self._initMovie();}
this._initMovie=function(){if(self.o)return false;self.o=self.getMovie(self.id);if(!self.o){self._createMovie(self.id,self.url);self.o=self.getMovie(self.id);}
if(self.o){self._writeDebug('soundManager._initMovie(): Got '+self.o.nodeName+' element ('+(self._didAppend?'created via JS':'static HTML')+')',1);}}
this.initComplete=function(){if(self._didInit)return false;self._didInit=true;self._writeDebug('-- SoundManager 2 '+(self._disabled?'failed to load':'loaded')+' ('+(self._disabled?'security/load error':'OK')+') --',1);if(self._disabled){self._writeDebug('soundManager.initComplete(): calling soundManager.onerror()',1);self.onerror.apply(window);return false;}
self._writeDebug('soundManager.initComplete(): calling soundManager.onload()',1);try{self.onload.apply(window);}catch(e){self._writeDebug('soundManager.onload() threw an exception: '+e.message,2);throw e;}
self._writeDebug('soundManager.onload() complete',1);}
this.init=function(){if(window.removeEventListener){window.removeEventListener('load',self.beginInit,false);}else if(window.detachEvent){window.detachEvent('onload',self.beginInit);}
try{self.o._externalInterfaceTest();self._writeDebug('Flash ExternalInterface call (JS -&gt; Flash) succeeded.',1);if(!self.allowPolling)self._writeDebug('Polling (whileloading/whileplaying support) is disabled.',1);self.setPolling(true);self.enabled=true;}catch(e){self._failSafely();self.initComplete();return false;}
self.initComplete();}
this.beginDelayedInit=function(){setTimeout(self.beginInit,200);}
this.beginInit=function(){self.createMovie();self._initMovie();setTimeout(self.init,1000);}
this.destruct=function(){if(self.isSafari){for(var i=self.soundIDs.length;i--;){if(self.sounds[self.soundIDs[i]].readyState==1)self.sounds[self.soundIDs[i]].unload();}}
self.disable();}}
function SMSound(oSM,oOptions){var self=this;var sm=oSM;this.sID=oOptions.id;this.url=oOptions.url;this.options=sm._mergeObjects(oOptions);this.id3={}
self.resetProperties=function(bLoaded){self.bytesLoaded=null;self.bytesTotal=null;self.position=null;self.duration=null;self.durationEstimate=null;self.loaded=false;self.loadSuccess=null;self.playState=0;self.paused=false;self.readyState=0;self.didBeforeFinish=false;self.didJustBeforeFinish=false;}
self.resetProperties();this.load=function(oOptions){self.loaded=false;self.loadSuccess=null;self.readyState=1;self.playState=(oOptions.autoPlay||false);var thisOptions=sm._mergeObjects(oOptions);if(typeof thisOptions.url=='undefined')thisOptions.url=self.url;try{sm._writeDebug('loading '+thisOptions.url,1);sm.o._load(self.sID,thisOptions.url,thisOptions.stream,thisOptions.autoPlay,thisOptions.whileloading?1:0);}catch(e){sm._writeDebug('SMSound().load(): JS-&gt;Flash communication failed.',2);}}
this.unload=function(){sm._writeDebug('SMSound().unload(): "'+self.sID+'"');self.setPosition(0);sm.o._unload(self.sID,sm.nullURL);self.resetProperties();}
this.play=function(oOptions){if(!oOptions)oOptions={};if(oOptions.onfinish)self.options.onfinish=oOptions.onfinish;if(oOptions.onbeforefinish)self.options.onbeforefinish=oOptions.onbeforefinish;if(oOptions.onjustbeforefinish)self.options.onjustbeforefinish=oOptions.onjustbeforefinish;var thisOptions=sm._mergeObjects(oOptions);if(self.playState==1){var allowMulti=thisOptions.multiShot;if(!allowMulti){sm._writeDebug('SMSound.play(): "'+self.sID+'" already playing? (one-shot)',1);return false;}else{sm._writeDebug('SMSound.play(): "'+self.sID+'" already playing (multi-shot)',1);}}
if(!self.loaded){if(self.readyState==0){sm._writeDebug('SMSound.play(): .play() before load request. Attempting to load "'+self.sID+'"',1);thisOptions.stream=true;thisOptions.autoPlay=true;self.load(thisOptions);}else if(self.readyState==2){sm._writeDebug('SMSound.play(): Could not load "'+self.sID+'" - exiting',2);return false;}else{sm._writeDebug('SMSound.play(): "'+self.sID+'" is loading - attempting to play..',1);}}else{sm._writeDebug('SMSound.play(): "'+self.sID+'"');}
if(self.paused){self.resume();}else{self.playState=1;self.position=(thisOptions.offset||0);if(thisOptions.onplay)thisOptions.onplay.apply(self);self.setVolume(thisOptions.volume);self.setPan(thisOptions.pan);if(!thisOptions.autoPlay){sm.o._start(self.sID,thisOptions.loop||1,self.position);}}}
this.start=this.play;this.stop=function(bAll){if(self.playState==1){self.playState=0;self.paused=false;if(sm.defaultOptions.onstop)sm.defaultOptions.onstop.apply(self);sm.o._stop(self.sID);}}
this.setPosition=function(nMsecOffset){sm.o._setPosition(self.sID,nMsecOffset/1000,self.paused||!self.playState);}
this.pause=function(){if(self.paused)return false;sm._writeDebug('SMSound.pause()');self.paused=true;sm.o._pause(self.sID);}
this.resume=function(){if(!self.paused)return false;sm._writeDebug('SMSound.resume()');self.paused=false;sm.o._pause(self.sID);}
this.togglePause=function(){sm._writeDebug('SMSound.togglePause()');if(!self.playState){self.play({offset:self.position/1000});return false;}
if(self.paused){sm._writeDebug('SMSound.togglePause(): resuming..');self.resume();}else{sm._writeDebug('SMSound.togglePause(): pausing..');self.pause();}}
this.setPan=function(nPan){if(typeof nPan=='undefined')nPan=0;sm.o._setPan(self.sID,nPan);self.options.pan=nPan;}
this.setVolume=function(nVol){if(typeof nVol=='undefined')nVol=100;sm.o._setVolume(self.sID,nVol);self.options.volume=nVol;}
this._whileloading=function(nBytesLoaded,nBytesTotal,nDuration){self.bytesLoaded=nBytesLoaded;self.bytesTotal=nBytesTotal;self.duration=nDuration;self.durationEstimate=parseInt((self.bytesTotal/self.bytesLoaded)*self.duration);if(self.readyState!=3&&self.options.whileloading)self.options.whileloading.apply(self);}
this._onid3=function(oID3PropNames,oID3Data){sm._writeDebug('SMSound()._onid3(): "'+this.sID+'" ID3 data received.');var oData=[];for(var i=0,j=oID3PropNames.length;i<j;i++){oData[oID3PropNames[i]]=oID3Data[i];}
self.id3=sm._mergeObjects(self.id3,oData);if(self.options.onid3)self.options.onid3.apply(self);}
this._whileplaying=function(nPosition){if(isNaN(nPosition)||nPosition==null)return false;self.position=nPosition;if(self.playState==1){if(self.options.whileplaying)self.options.whileplaying.apply(self);if(self.loaded&&self.options.onbeforefinish&&self.options.onbeforefinishtime&&!self.didBeforeFinish&&self.duration-self.position<=self.options.onbeforefinishtime){sm._writeDebug('duration-position &lt;= onbeforefinishtime: '+self.duration+' - '+self.position+' &lt= '+self.options.onbeforefinishtime+' ('+(self.duration-self.position)+')');self._onbeforefinish();}}}
this._onload=function(bSuccess){bSuccess=(bSuccess==1?true:false);sm._writeDebug('SMSound._onload(): "'+self.sID+'"'+(bSuccess?' loaded.':' failed to load (or loaded from cache - weird bug) - [<a href="'+self.url+'">test URL</a>]'));self.loaded=bSuccess;self.loadSuccess=bSuccess;self.readyState=bSuccess?3:2;if(self.options.onload)self.options.onload.apply(self);}
this._onbeforefinish=function(){if(!self.didBeforeFinish){self.didBeforeFinish=true;if(self.options.onbeforefinish)self.options.onbeforefinish.apply(self);}}
this._onjustbeforefinish=function(msOffset){if(!self.didJustBeforeFinish){self.didJustBeforeFinish=true;if(self.options.onjustbeforefinish)self.options.onjustbeforefinish.apply(self);;}}
this._onfinish=function(){sm._writeDebug('SMSound._onfinish(): "'+self.sID+'"');self.playState=0;self.paused=false;if(self.options.onfinish)self.options.onfinish.apply(self);if(self.options.onbeforefinishcomplete)self.options.onbeforefinishcomplete.apply(self);self.setPosition(0);self.didBeforeFinish=false;self.didJustBeforeFinish=false;}}
var soundManager=new SoundManager();if(window.addEventListener){window.addEventListener('load',soundManager.beginDelayedInit,false);window.addEventListener('beforeunload',soundManager.destruct,false);}else if(window.attachEvent){window.attachEvent('onload',soundManager.beginInit);window.attachEvent('beforeunload',soundManager.destruct);}else{soundManager.onerror();soundManager.disable();}
function RegistrationReport()
{}
function cpa()
{try{}
catch(e){}}
function dsnr()
{try{}
catch(e){}}
function SendToFriend(url)
{(pu_SentToFriend=new Popup('pu_SentToFriend','SendURLToFriend.aspx+',window,null,new Array(url))).show()}
function MarkAsInteresting(aObj)
{var status=aObj.getAttribute("status").toLowerCase();var questionID=Number(aObj.getAttribute("qid"));if(status=="unmarked")
iMedix.Web.KnowledgeRetrievalInterface.MarkAsInteresting(questionID,MarkAsInterestingCB,aObj);else
iMedix.Web.KnowledgeRetrievalInterface.UnMarkAsInteresting(questionID,MarkAsInterestingCB,aObj);}
function MarkAsInterestingCB(res)
{var aObj=res.context;var status=aObj.getAttribute("status").toLowerCase();if(res.value)
{if(status=="unmarked")
aObj.setAttribute("status","marked");else
aObj.setAttribute("status","unmarked");aObj.innerHTML="<img src=\"/media/images/icons/notifyQ.gif\" alt=\"\" align=\"middle\" /> ";if(aObj.getAttribute("status")=="marked")
aObj.innerHTML+="Remove notifications for this question";else
aObj.innerHTML+="Notify me on new answers";}}
function CharactersIndicator_down(ev)
{}
function CharactersIndicator_up(ev)
{ev=ev==null?event:ev;var inp=ev.target||ev.srcElement;checkMaxLength_up(ev,inp,eval(inp.getAttribute("CharactersSmartID")))}
function checkMaxLength_down(ev,inp,charecters){if(lblErrQuestionBox&&lblErrQuestionBox.style.display==""){lblErrQuestionBox.style.display="none";lblCharacters.parentNode.style.display="";}
var keyPressed=ev.charCode||ev.keyCode;var maxLength=inp.getAttribute('maxlength');var currentLength=inp.value.length;if(maxLength<=currentLength)
{switch(keyPressed)
{case 8:case 35:case 36:case 37:case 38:case 39:case 40:case 46:case 16:break;default:return false;break;}}}
function checkMaxLength_up(ev,inp,charecters)
{var keyPressed=ev.charCode||ev.keyCode;var maxLength=inp.getAttribute('maxlength');var currentLength=inp.value.length;charecters.innerHTML=maxLength-currentLength>=0?maxLength-currentLength:0;}
function ValidateQuestionForm(obj)
{document.getElementById("errQuestionDescription").style.display="none";inpDescription.style.borderColor="";inpDescription.style.borderStyle="";document.getElementById("errQuestion").innerHTML="";document.getElementById("errQuestion").style.display="none";inpQuestion.style.borderColor="";inpQuestion.style.borderStyle="";var isValid=true;isValid=validateForm();var maxLength=inpQuestion.getAttribute('maxlength');var currentLength=inpQuestion.value.trim().length;document.getElementById("errQuestion").innerHTML="<img src=\"/media/images/general/errorArrow.gif\" alt=\"\" /> ";if(currentLength==0)
{document.getElementById("errQuestion").innerHTML+="Please enter your question";inpQuestion.style.borderColor="red";inpQuestion.style.borderStyle="solid";document.getElementById("errQuestion").style.display="";isValid=false;}
else if(maxLength<currentLength)
{document.getElementById("errQuestion").innerHTML+="The question you asked seems to be too long. Please make it shorter, you can use the below box to expend your question";inpQuestion.style.borderColor="red";inpQuestion.style.borderStyle="solid";document.getElementById("errQuestion").style.display="";isValid=false;}
var maxLength=inpDescription.getAttribute('maxlength');var currentLength=inpDescription.value.length;if(maxLength<currentLength)
{inpDescription.style.borderColor="red";inpDescription.style.borderStyle="solid";document.getElementById("errQuestionDescription").style.display="";isValid=false;}
return isValid;}
function ValidateAnswerForm(obj)
{document.getElementById("errAnswer").style.display="none";inpAnswer.style.borderColor="";inpAnswer.style.borderStyle="";var isValid=true;var maxLength=inpAnswer.getAttribute('maxlength');var currentLength=inpAnswer.value.length;if(currentLength==0||maxLength<=currentLength)
{isValid=false;inpAnswer.style.borderColor="red";inpAnswer.style.borderStyle="solid";document.getElementById("errAnswer").innerHTML="<img src=\"/media/images/general/errorArrow.gif\" alt=\"\" />";if(currentLength==0)
document.getElementById("errAnswer").innerHTML+="Please enter your answer";else if(maxLength<=currentLength)
document.getElementById("errAnswer").innerHTML+="The answer you provided seem to be too long. Please make it shorter";document.getElementById("errAnswer").style.display="";}
return isValid;}
function RateAnswer(btnObj,Color)
{var bVote=eval(btnObj.getAttribute("Vote"));var AnswerID=btnObj.getAttribute("AnswerID");var UserID=btnObj.getAttribute("UserID");var QuestionID=btnObj.getAttribute("QuestionID");btnsContainer=getParentElement(btnObj,"div");Color=isNullOrUndefined(Color)?"#3CA008":Color;btns=btnsContainer.getElementsByTagName("IMG");btns[0].src="/media/images/Icons/tmbU2.gif";btns[1].src="/media/images/Icons/tmbD2.gif";btnsContainer.innerHTML=btnsContainer.innerHTML.replace("Did you find this answer useful?","Thank you for voting!");btnsContainer.style.color=Color;hrefs=btnsContainer.getElementsByTagName("B");hrefs[0].onclick=function(){};hrefs[1].onclick=function(){};hrefs[0].style.cursor="default";hrefs[1].style.cursor="default";if(bVote)
{var lblCount=btnsContainer.getElementsByTagName("LABEL")[0];lblCount.style.color="#3CA008";}
else
{var lblCount=btnsContainer.getElementsByTagName("LABEL")[1];lblCount.style.color="#EB3302";}
lblCount.innerHTML="("+(Number(lblCount.innerHTML.replace("(","").replace(")",""))+1)+")";iMedix.Web.KnowledgeRetrievalInterface.CreateAnswerRating(UserID,QuestionID,AnswerID,bVote);}
function ResolveQuestion(QuestionID,SucsessScript)
{SucsessScript=isNullOrUndefined(SucsessScript)?"refresh();":SucsessScript;(pu_ResolveQuestion=new Popup("pu_ResolveQuestion","ResolveQuestion.aspx",window,SucsessScript,new Array(QuestionID.toString()))).show();}
function ValidateQuestionBox(inpQuestion,lblErrQuestionBox){var isValid=true;lblErrQuestionBox.style.display="none";lblCharacters.parentNode.style.display="";var maxLength=inpQuestion.getAttribute('maxlength');var currentLength=inpQuestion.value.length;lblErrQuestionBox.innerHTML="<img src=\"/media/images/general/errorArrow.gif\" alt=\"\" /> ";if(currentLength==0||inpQuestion.value=="Type your health question"||inpQuestion.value=="Type your health question..."){lblErrQuestionBox.innerHTML+="Please enter your question";lblCharacters.parentNode.style.display="none";lblErrQuestionBox.style.display="";isValid=false;}
else if(maxLength<currentLength)
{lblErrQuestionBox.innerHTML+="The question seems to be too long";lblCharacters.parentNode.style.display="none";lblErrQuestionBox.style.display="";isValid=false;}
inpQuestion.focus();return isValid;}
function scrollToBottom()
{window.scrollTo(0,600);}
SearchHandler=null;function formatQuery(query)
{query=query.replace(/\s+/g,'_');wordsArr=query.split("_");query="";for(var i=0;i<wordsArr.length;i++){wordsArr[i]=wordsArr[i].toLowerCase()
query+=wordsArr[i];if(i!=wordsArr.length-1)
query+="_";}
return encodeURIComponent(query);}
function GeneralSearchLogicObj()
{this.search=function(query){try{if(query!=null){QueryGuide.style.display='none';q.focus();q.value=query;}
if(!q.value)
return;query=formatQuery(q.value);launchLink(String.format(this.friendlyUrl,query));}
catch(e){}}
this.doSort=function(byCol){}
this.close=function(){}
this.open=function(){}}
AllSearchLogic=new GeneralSearchLogicObj();QNASearchLogic=new GeneralSearchLogicObj();WebSearchLogic=new GeneralSearchLogicObj();VideosSearchLogic=new GeneralSearchLogicObj();DefinitionSearchLogic=new GeneralSearchLogicObj();function searchTypeClick(SearchTypeObj,typeClickedObj){if(SearchHandler==null||SearchTypeObj.innerHTML!=typeClickedObj.innerHTML){SearchTypeObj.innerHTML=typeClickedObj.innerHTML;switch(SearchTypeObj.innerText.trim()){case"All":switchSeachType(AllSearchLogic,typeClickedObj);break;case"People":if(typeof(PeopleSearchLogic)=="undefined"){divElm=loadModule("/pages/dialogs/MembersSearchPanel.aspx");if(divElm!=null){divElm.style.display="none";divElm.style.height="1px";SearchControlsContainer.appendChild(divElm);}}
switchSeachType(PeopleSearchLogic,typeClickedObj);break;case"Q&A":switchSeachType(QNASearchLogic,typeClickedObj);break;case"Articles":switchSeachType(WebSearchLogic,typeClickedObj);break;case"Videos":switchSeachType(VideosSearchLogic,typeClickedObj);case"Definition":switchSeachType(DefinitionSearchLogic,typeClickedObj);break;}}
SearchTypeObj.selector.closePanel();}
function switchSeachType(newType,SearchTypeElm)
{if(SearchHandler!=null)
SearchHandler.close();SearchHandler=newType;SearchHandler.rawUrl=SearchTypeElm.getAttribute("RawUrl")
SearchHandler.friendlyUrl=SearchTypeElm.getAttribute("FriendlyUrl")
SearchHandler.open();}
function ExecuteSearchAll(query,friendlyUrl,rawUrl){SearchHandler=AllSearchLogic;SearchHandler.rawUrl=rawUrl;SearchHandler.friendlyUrl=friendlyUrl;SearchHandler.search(query)}
function ExecuteSearch(searchType,query){searchTypeClick(searchTypeDD,getSingleElementByCondition(function(el){return el.tagName=="LI"&&el.innerHTML.trim()==searchType.trim()},searchTypeExpander))
SearchHandler.search(query)}
function ExecuteWebSearch(query){ExecuteSearch("Articles",isNullOrUndefined(query)?"healthcare":query);}
function ExecuteAllSearch(query)
{ExecuteSearch("All",query);}
function ExecuteDefSearch(query)
{ExecuteSearch("Definition",query);}
function ExecuteQNASearch(query)
{if(isNullOrUndefined(query))
{launchLink("/questions");return;}
ExecuteSearch("Q&amp;A",query);}
function ExecuteVidSearch(query)
{ExecuteSearch("Videos",isNullOrUndefined(query)?"healthcare":query);}
function DisableLblError(){if(typeof(lblErrPeopleSearchBox)==undefined||lblErrPeopleSearchBox==undefined||lblErrPeopleSearchBox==null)
return;lblErrPeopleSearchBox.style.display="none";}
function FriendsPaging(obj,username){var pageNum=obj.getAttribute("PageNum");var ul=getElementByTagAndId("ul","ulFriends");var container=ul.parentNode;obj.innerHTML="<img src=\"/media/images/general/ajax-loader-SMALL.gif\" border=\"0\">"
var res=iMedix.Web.Helpers.PopupHelper.GetHtmlContent("/pages/people/MyFriends.aspx?UserName="+username+"&PageNum="+pageNum);window.setTimeout(function(){container.innerHTML=res.value;},Constants.Timeout)}Object.extend=function(dest,source,replace){for(var prop in source){if(replace==false&&dest[prop]!=null){continue;}
dest[prop]=source[prop];}
return dest;};Object.extend(Function.prototype,{apply:function(o,a){var r,x="__fapply";if(typeof o!="object"){o={};}
o[x]=this;var s="r = o."+x+"(";for(var i=0;i<a.length;i++){if(i>0){s+=",";}
s+="a["+i+"]";}
s+=");";eval(s);delete o[x];return r;},bind:function(o){if(!Function.__objs){Function.__objs=[];Function.__funcs=[];}
var objId=o.__oid;if(!objId){Function.__objs[objId=o.__oid=Function.__objs.length]=o;}
var me=this;var funcId=me.__fid;if(!funcId){Function.__funcs[funcId=me.__fid=Function.__funcs.length]=me;}
if(!o.__closures){o.__closures=[];}
var closure=o.__closures[funcId];if(closure){return closure;}
o=null;me=null;return Function.__objs[objId].__closures[funcId]=function(){return Function.__funcs[funcId].apply(Function.__objs[objId],arguments);};}},false);Object.extend(Array.prototype,{push:function(o){this[this.length]=o;},addRange:function(items){if(items.length>0){for(var i=0;i<items.length;i++){this.push(items[i]);}}},clear:function(){this.length=0;return this;},shift:function(){if(this.length==0){return null;}
var o=this[0];for(var i=0;i<this.length-1;i++){this[i]=this[i+1];}
this.length--;return o;}},false);Object.extend(String.prototype,{trimLeft:function(){return this.replace(/^\s*/,"");},trimRight:function(){return this.replace(/\s*$/,"");},trim:function(){return this.trimRight().trimLeft();},endsWith:function(s){if(this.length==0||this.length<s.length){return false;}
return(this.substr(this.length-s.length)==s);},startsWith:function(s){if(this.length==0||this.length<s.length){return false;}
return(this.substr(0,s.length)==s);},split:function(c){var a=[];if(this.length==0)return a;var p=0;for(var i=0;i<this.length;i++){if(this.charAt(i)==c){a.push(this.substring(p,i));p=++i;}}
a.push(s.substr(p));return a;}},false);Object.extend(String,{format:function(s){for(var i=1;i<arguments.length;i++){s=s.replace("{"+(i-1)+"}",arguments[i]);}
return s;},isNullOrEmpty:function(s){if(s==null||s.length==0){return true;}
return false;}},false);if(typeof addEvent=="undefined")
addEvent=function(o,evType,f,capture){if(o==null){return false;}
if(o.addEventListener){o.addEventListener(evType,f,capture);return true;}else if(o.attachEvent){var r=o.attachEvent("on"+evType,f);return r;}else{try{o["on"+evType]=f;}catch(e){}}};if(typeof removeEvent=="undefined")
removeEvent=function(o,evType,f,capture){if(o==null){return false;}
if(o.removeEventListener){o.removeEventListener(evType,f,capture);return true;}else if(o.detachEvent){o.detachEvent("on"+evType,f);}else{try{o["on"+evType]=function(){};}catch(e){}}};Object.extend(Function.prototype,{getArguments:function(){var args=[];for(var i=0;i<this.arguments.length;i++){args.push(this.arguments[i]);}
return args;}},false);var MS={"Browser":{}};Object.extend(MS.Browser,{isIE:navigator.userAgent.indexOf('MSIE')!=-1,isFirefox:navigator.userAgent.indexOf('Firefox')!=-1,isOpera:window.opera!=null},false);var AjaxPro={};AjaxPro.IFrameXmlHttp=function(){};AjaxPro.IFrameXmlHttp.prototype={onreadystatechange:null,headers:[],method:"POST",url:null,async:true,iframe:null,status:0,readyState:0,responseText:null,abort:function(){},readystatechanged:function(){var doc=this.iframe.contentDocument||this.iframe.document;if(doc!=null&&doc.readyState=="complete"&&doc.body!=null&&doc.body.res!=null){this.status=200;this.statusText="OK";this.readyState=4;this.responseText=doc.body.res;this.onreadystatechange();return;}
setTimeout(this.readystatechanged.bind(this),10);},open:function(method,url,async){if(async==false){alert("Synchronous call using IFrameXMLHttp is not supported.");return;}
if(this.iframe==null){var iframeID="hans";if(document.createElement&&document.documentElement&&(window.opera||navigator.userAgent.indexOf('MSIE 5.0')==-1))
{var ifr=document.createElement('iframe');ifr.setAttribute('id',iframeID);ifr.style.visibility='hidden';ifr.style.position='absolute';ifr.style.width=ifr.style.height=ifr.borderWidth='0px';this.iframe=document.getElementsByTagName('body')[0].appendChild(ifr);}
else if(document.body&&document.body.insertAdjacentHTML)
{document.body.insertAdjacentHTML('beforeEnd','<iframe name="'+iframeID+'" id="'+iframeID+'" style="border:1px solid black;display:none"></iframe>');}
if(window.frames&&window.frames[iframeID]){this.iframe=window.frames[iframeID];}
this.iframe.name=iframeID;this.iframe.document.open();this.iframe.document.write("<"+"html><"+"body></"+"body></"+"html>");this.iframe.document.close();}
this.method=method;this.url=url;this.async=async;},setRequestHeader:function(name,value){for(var i=0;i<this.headers.length;i++){if(this.headers[i].name==name){this.headers[i].value=value;return;}}
this.headers.push({"name":name,"value":value});},getResponseHeader:function(name,value){return null;},addInput:function(doc,form,name,value){var ele;var tag="input";if(value.indexOf("\n")>=0){tag="textarea";}
if(doc.all){ele=doc.createElement("<"+tag+" name=\""+name+"\" />");}else{ele=doc.createElement(tag);ele.setAttribute("name",name);}
ele.setAttribute("value",value);form.appendChild(ele);ele=null;},send:function(data){if(this.iframe==null){return;}
var doc=this.iframe.contentDocument||this.iframe.document;var form=doc.createElement("form");doc.body.appendChild(form);form.setAttribute("action",this.url);form.setAttribute("method",this.method);form.setAttribute("enctype","application/x-www-form-urlencoded");for(var i=0;i<this.headers.length;i++){switch(this.headers[i].name.toLowerCase()){case"content-length":case"accept-encoding":case"content-type":break;default:this.addInput(doc,form,this.headers[i].name,this.headers[i].value);}}
this.addInput(doc,form,"data",data);form.submit();setTimeout(this.readystatechanged.bind(this),0);}};var progids=["Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"];var progid=null;if(typeof ActiveXObject!="undefined"){var ie7xmlhttp=false;if(typeof XMLHttpRequest=="object"){try{var o=new XMLHttpRequest();ie7xmlhttp=true;}catch(e){}}
if(typeof XMLHttpRequest=="undefined"||!ie7xmlhttp){XMLHttpRequest=function(){var xmlHttp=null;if(!AjaxPro.noActiveX){if(progid!=null){return new ActiveXObject(progid);}
for(var i=0;i<progids.length&&xmlHttp==null;i++){try{xmlHttp=new ActiveXObject(progids[i]);progid=progids[i];}catch(e){}}}
if(xmlHttp==null&&MS.Browser.isIE){return new AjaxPro.IFrameXmlHttp();}
return xmlHttp;};}}
Object.extend(AjaxPro,{noOperation:function(){},onLoading:function(){},onError:function(){},onTimeout:function(){return true;},onStateChanged:function(){},cryptProvider:null,queue:null,token:"",version:"7.7.31.1",ID:"AjaxPro",noActiveX:false,timeoutPeriod:15*1000,queue:null,noUtcTime:false,regExDate:function(str,p1,p2,offset,s){str=str.substring(1).replace('"','');var date=str;if(str.substring(0,7)=="\\\/Date("){str=str.match(/Date\((.*?)\)/)[1];date="new Date("+parseInt(str)+")";}
else{var matches=str.split(/[-,:,T,Z]/);matches[1]=(parseInt(matches[1],0)-1).toString();date="new Date(Date.UTC("+matches.join(",")+"))";}
return date;},parse:function(text){var regEx=/(\"\d{4}-\d{2}-\d{2}T\d{2}:\d{2}.*?\")|(\"\\\/Date\(.*?\)\\\/")/g;text=text.replace(regEx,this.regExDate);return eval('('+text+')');},m:{'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'},toJSON:function(o){if(o==null){return"null";}
var v=[];var i;var c=o.constructor;if(c==Number){return isFinite(o)?o.toString():AjaxPro.toJSON(null);}else if(c==Boolean){return o.toString();}else if(c==String){if(/["\\\x00-\x1f]/.test(o)){o=o.replace(/([\x00-\x1f\\"])/g,function(a,b){var c=AjaxPro.m[b];if(c){return c;}
c=b.charCodeAt();return'\\u00'+
Math.floor(c/16).toString(16)+
(c%16).toString(16);});}
return'"'+o+'"';}else if(c==Array){for(i=0;i<o.length;i++){v.push(AjaxPro.toJSON(o[i]));}
return"["+v.join(",")+"]";}else if(c==Date){return AjaxPro.toJSON("/Date("+new Date(Date.UTC(o.getUTCFullYear(),o.getUTCMonth(),o.getUTCDate(),o.getUTCHours(),o.getUTCMinutes(),o.getUTCSeconds(),o.getUTCMilliseconds())).getTime()+")/");}
if(typeof o.toJSON=="function"){return o.toJSON();}
if(typeof o=="object"){for(var attr in o){if(typeof o[attr]!="function"){v.push('"'+attr+'":'+AjaxPro.toJSON(o[attr]));}}
if(v.length>0){return"{"+v.join(",")+"}";}
return"{}";}
return o.toString();},dispose:function(){if(AjaxPro.queue!=null){AjaxPro.queue.dispose();}}},false);addEvent(window,"unload",AjaxPro.dispose);AjaxPro.Request=function(url){this.url=url;this.xmlHttp=null;};AjaxPro.Request.prototype={url:null,callback:null,onLoading:null,onError:null,onTimeout:null,onStateChanged:null,args:null,context:null,isRunning:false,abort:function(){if(this.timeoutTimer!=null){clearTimeout(this.timeoutTimer);}
if(this.xmlHttp){this.xmlHttp.onreadystatechange=AjaxPro.noOperation;this.xmlHttp.abort();}
if(this.isRunning){this.isRunning=false;if(typeof(onLoading)!="undefined")
this.onLoading(false);}},dispose:function(){this.abort();},getEmptyRes:function(){return{error:null,value:null,request:{method:this.method,args:this.args},context:this.context,duration:this.duration};},endRequest:function(res){this.abort();if(res.error!=null){this.onError(res.error,this);}
if(typeof this.callback=="function"){this.callback(res,this);}},mozerror:function(){if(this.timeoutTimer!=null){clearTimeout(this.timeoutTimer);}
var res=this.getEmptyRes();res.error={Message:"Unknown",Type:"ConnectFailure",Status:0};this.endRequest(res);},doStateChange:function(){this.onStateChanged(this.xmlHttp.readyState,this);if(this.xmlHttp.readyState!=4||!this.isRunning){return;}
this.duration=new Date().getTime()-this.__start;if(this.timeoutTimer!=null){clearTimeout(this.timeoutTimer);}
var res=this.getEmptyRes();if(this.xmlHttp.status==200&&this.xmlHttp.statusText=="OK"){res=this.createResponse(res);}else{res=this.createResponse(res,true);res.error={Message:this.xmlHttp.statusText,Type:"ConnectFailure",Status:this.xmlHttp.status};}
this.endRequest(res);},createResponse:function(r,noContent){if(!noContent){if(typeof(this.xmlHttp.responseText)=="unknown"){r.error={Message:"XmlHttpRequest error reading property responseText.",Type:"XmlHttpRequestException"};return r;}
var responseText=""+this.xmlHttp.responseText;if(AjaxPro.cryptProvider!=null&&typeof AjaxPro.cryptProvider.decrypt=="function"){responseText=AjaxPro.cryptProvider.decrypt(responseText);}
if(this.xmlHttp.getResponseHeader("Content-Type")=="text/xml"){r.value=this.xmlHttp.responseXML;}else{if(responseText!=null&&responseText.trim().length>0){r.json=responseText;var v=null;v=AjaxPro.parse(responseText);if(v!=null){if(typeof v.value!="undefined")r.value=v.value;else if(typeof v.error!="undefined")r.error=v.error;}}}}
return r;},timeout:function(){this.duration=new Date().getTime()-this.__start;var r="undefined";if(typeof(this.onTimeout)=="function")
r=this.onTimeout(this.duration,this);if(typeof r=="undefined"||r!=false){this.abort();}else{this.timeoutTimer=setTimeout(this.timeout.bind(this),AjaxPro.timeoutPeriod);}},invoke:function(method,args,callback,context){this.__start=new Date().getTime();this.xmlHttp=new XMLHttpRequest();this.isRunning=true;this.method=method;this.args=args;this.callback=callback;this.context=context;var async=typeof(callback)=="function"&&callback!=AjaxPro.noOperation;if(async){if(MS.Browser.isIE){this.xmlHttp.onreadystatechange=this.doStateChange.bind(this);}else{this.xmlHttp.onload=this.doStateChange.bind(this);this.xmlHttp.onerror=this.mozerror.bind(this);}
this.onLoading(true);}
var json=AjaxPro.toJSON(args)+"";if(AjaxPro.cryptProvider!=null&&typeof AjaxPro.cryptProvider.encrypt=="function"){json=AjaxPro.cryptProvider.encrypt(json);}
this.xmlHttp.open("POST",this.url,async);this.xmlHttp.setRequestHeader("Content-Type","text/plain; charset=utf-8");this.xmlHttp.setRequestHeader("X-"+AjaxPro.ID+"-Method",method);if(AjaxPro.token!=null&&AjaxPro.token.length>0){this.xmlHttp.setRequestHeader("X-"+AjaxPro.ID+"-Token",AjaxPro.token);}
this.timeoutTimer=setTimeout(this.timeout.bind(this),AjaxPro.timeoutPeriod);try{this.xmlHttp.send(json);}catch(e){}
if(!async){return this.createResponse({error:null,value:null});}
return true;}};AjaxPro.RequestQueue=function(conc){this.queue=[];this.requests=[];this.timer=null;if(isNaN(conc)){conc=2;}
for(var i=0;i<conc;i++){this.requests[i]=new AjaxPro.Request();this.requests[i].callback=function(res){var r=res.context;res.context=r[3][1];r[3][0](res,this);};this.requests[i].callbackHandle=this.requests[i].callback.bind(this.requests[i]);}
this.processHandle=this.process.bind(this);};AjaxPro.RequestQueue.prototype={process:function(){this.timer=null;if(this.queue.length==0){return;}
for(var i=0;i<this.requests.length&&this.queue.length>0;i++){if(this.requests[i].isRunning==false){var r=this.queue.shift();this.requests[i].url=r[0];this.requests[i].onLoading=r[3].length>2&&r[3][2]!=null&&typeof r[3][2]=="function"?r[3][2]:AjaxPro.onLoading;this.requests[i].onError=r[3].length>3&&r[3][3]!=null&&typeof r[3][3]=="function"?r[3][3]:AjaxPro.onError;this.requests[i].onTimeout=r[3].length>4&&r[3][4]!=null&&typeof r[3][4]=="function"?r[3][4]:AjaxPro.onTimeout;this.requests[i].onStateChanged=r[3].length>5&&r[3][5]!=null&&typeof r[3][5]=="function"?r[3][5]:AjaxPro.onStateChanged;this.requests[i].invoke(r[1],r[2],this.requests[i].callbackHandle,r);r=null;}}
if(this.queue.length>0&&this.timer==null){this.timer=setTimeout(this.processHandle,0);}},add:function(url,method,args,e){this.queue.push([url,method,args,e]);if(this.timer==null){this.timer=setTimeout(this.processHandle,0);}},abort:function(){this.queue.length=0;if(this.timer!=null){clearTimeout(this.timer);}
this.timer=null;for(var i=0;i<this.requests.length;i++){if(this.requests[i].isRunning==true){this.requests[i].abort();}}},dispose:function(){for(var i=0;i<this.requests.length;i++){var r=this.requests[i];r.dispose();}
this.requests.clear();}};AjaxPro.queue=new AjaxPro.RequestQueue(2);AjaxPro.AjaxClass=function(url){this.url=url;};AjaxPro.AjaxClass.prototype={invoke:function(method,args,e){if(e!=null){if(e.length!=6){for(;e.length<6;){e.push(null);}}
if(e[0]!=null&&typeof(e[0])=="function"){return AjaxPro.queue.add(this.url,method,args,e);}}
var r=new AjaxPro.Request();r.url=this.url;return r.invoke(method,args);}};if(typeof Ajax=="undefined")Ajax={};if(typeof Ajax.Web=="undefined")Ajax.Web={};if(typeof Ajax.Web.NameValueCollection=="undefined")Ajax.Web.NameValueCollection={};Ajax.Web.NameValueCollection=function(items){this.__type="System.Collections.Specialized.NameValueCollection";this.keys=[];this.values=[];if(items!=null&&!isNaN(items.length)){for(var i=0;i<items.length;i++)
this.add(items[i][0],items[i][1]);}};Object.extend(Ajax.Web.NameValueCollection.prototype,{add:function(k,v){if(k==null||k.constructor!=String||v==null||v.constructor!=String)
return-1;this.keys.push(k);this.values.push(v);return this.values.length-1;},containsKey:function(key){for(var i=0;i<this.keys.length;i++){if(this.keys[i]==key)return true;}
return false;},getKeys:function(){return this.keys;},getValue:function(k){for(var i=0;i<this.keys.length&&i<this.values.length;i++){if(this.keys[i]==k)return this.values[i];}
return null;},setValue:function(k,v){if(k==null||k.constructor!=String||v==null||v.constructor!=String)
return-1;for(var i=0;i<this.keys.length&&i<this.values.length;i++){if(this.keys[i]==k)this.values[i]=v;return i;}
return this.add(k,v);},toJSON:function(){return AjaxPro.toJSON({__type:this.__type,keys:this.keys,values:this.values});}},true);if(typeof Ajax=="undefined")Ajax={};if(typeof Ajax.Web=="undefined")Ajax.Web={};if(typeof Ajax.Web.DataSet=="undefined")Ajax.Web.DataSet={};Ajax.Web.DataSet=function(t){this.__type="System.Data.DataSet,System.Data";this.Tables=[];this.addTable=function(t){this.Tables.push(t);};if(t!=null){for(var i=0;i<t.length;i++){this.addTable(t[i]);}}};if(typeof Ajax=="undefined")Ajax={};if(typeof Ajax.Web=="undefined")Ajax.Web={};if(typeof Ajax.Web.DataTable=="undefined")Ajax.Web.DataTable={};Ajax.Web.DataTable=function(c,r){this.__type="System.Data.DataTable,System.Data";this.Columns=[];this.Rows=[];this.addColumn=function(name,type){this.Columns.push({Name:name,__type:type});};this.toJSON=function(){var dt={};var i;dt.Columns=[];for(i=0;i<this.Columns.length;i++)
dt.Columns.push([this.Columns[i].Name,this.Columns[i].__type]);dt.Rows=[];for(i=0;i<this.Rows.length;i++){var row=[];for(var j=0;j<this.Columns.length;j++)
row.push(this.Rows[i][this.Columns[j].Name]);dt.Rows.push(row);}
return AjaxPro.toJSON(dt);};this.addRow=function(row){this.Rows.push(row);};if(c!=null){for(var i=0;i<c.length;i++)
this.addColumn(c[i][0],c[i][1]);}
if(r!=null){for(var y=0;y<r.length;y++){var row={};for(var z=0;z<this.Columns.length&&z<r[y].length;z++)
row[this.Columns[z].Name]=r[y][z];this.addRow(row);}}};if(typeof Ajax=="undefined")Ajax={};if(typeof Ajax.Web=="undefined")Ajax.Web={};if(typeof Ajax.Web.Profile=="undefined")Ajax.Web.Profile={};Ajax.Web.Profile=function(){this.toJSON=function(){throw"Ajax.Web.Profile cannot be converted to JSON format.";};this.setProperty_callback=function(res){};this.setProperty=function(name,object){this[name]=object;AjaxPro.Services.Profile.SetProfile({name:o},this.setProperty_callback.bind(this));};};if(typeof Ajax=="undefined")Ajax={};if(typeof Ajax.Web=="undefined")Ajax.Web={};if(typeof Ajax.Web.Dictionary=="undefined")Ajax.Web.Dictionary={};Ajax.Web.Dictionary=function(type,items){this.__type=type;this.keys=[];this.values=[];if(items!=null&&!isNaN(items.length)){for(var i=0;i<items.length;i++)
this.add(items[i][0],items[i][1]);}};Object.extend(Ajax.Web.Dictionary.prototype,{add:function(k,v){this.keys.push(k);this.values.push(v);return this.values.length-1;},containsKey:function(key){for(var i=0;i<this.keys.length;i++){if(this.keys[i]==key)return true;}
return false;},getKeys:function(){return this.keys;},getValue:function(key){for(var i=0;i<this.keys.length&&i<this.values.length;i++){if(this.keys[i]==key){return this.values[i];}}
return null;},setValue:function(k,v){for(var i=0;i<this.keys.length&&i<this.values.length;i++){if(this.keys[i]==k){this.values[i]=v;}
return i;}
return this.add(k,v);},toJSON:function(){return AjaxPro.toJSON({__type:this.__type,keys:this.keys,values:this.values});}},true);if(typeof iMedix=="undefined")iMedix={};if(typeof iMedix.Web=="undefined")iMedix.Web={};if(typeof iMedix.Web.GlobalAjaxFunctions_class=="undefined")iMedix.Web.GlobalAjaxFunctions_class={};iMedix.Web.GlobalAjaxFunctions_class=function(){};Object.extend(iMedix.Web.GlobalAjaxFunctions_class.prototype,Object.extend(new AjaxPro.AjaxClass(),{CreateElementStat:function(statsType,URL,additionalInfo){return this.invoke("CreateElementStat",{"statsType":statsType,"URL":URL,"additionalInfo":additionalInfo},this.CreateElementStat.getArguments().slice(3));},RecordSearchPageStat:function(pageNum,query,parameters){return this.invoke("RecordSearchPageStat",{"pageNum":pageNum,"query":query,"parameters":parameters},this.RecordSearchPageStat.getArguments().slice(3));},RecordQandASearchPageStat:function(pageNum,query,parameters){return this.invoke("RecordQandASearchPageStat",{"pageNum":pageNum,"query":query,"parameters":parameters},this.RecordQandASearchPageStat.getArguments().slice(3));},RecordMembersSearchPageStat:function(pageNum,query,parameters){return this.invoke("RecordMembersSearchPageStat",{"pageNum":pageNum,"query":query,"parameters":parameters},this.RecordMembersSearchPageStat.getArguments().slice(3));},RecordVideosSearchPageStat:function(pageNum,query,parameters){return this.invoke("RecordVideosSearchPageStat",{"pageNum":pageNum,"query":query,"parameters":parameters},this.RecordVideosSearchPageStat.getArguments().slice(3));},RecordAllSearchPageStat:function(pageNum,query,parameters){return this.invoke("RecordAllSearchPageStat",{"pageNum":pageNum,"query":query,"parameters":parameters},this.RecordAllSearchPageStat.getArguments().slice(3));},RecordPageStat:function(parameters){return this.invoke("RecordPageStat",{"parameters":parameters},this.RecordPageStat.getArguments().slice(1));},AddInterest:function(TagName){return this.invoke("AddInterest",{"TagName":TagName},this.AddInterest.getArguments().slice(1));},AddInterestReturnUserName:function(TagName){return this.invoke("AddInterestReturnUserName",{"TagName":TagName},this.AddInterestReturnUserName.getArguments().slice(1));},url:'/ajaxpro/iMedix.Web.AjaxProInterfaces.GlobalAjaxFunctions,App_Code.s4ovwmes.ashx'}));iMedix.Web.GlobalAjaxFunctions=new iMedix.Web.GlobalAjaxFunctions_class();if(typeof iMedix=="undefined")iMedix={};if(typeof iMedix.Web=="undefined")iMedix.Web={};if(typeof iMedix.Web.InstantMessaging=="undefined")iMedix.Web.InstantMessaging={};if(typeof iMedix.Web.InstantMessaging.InstantMessagingInterface_class=="undefined")iMedix.Web.InstantMessaging.InstantMessagingInterface_class={};iMedix.Web.InstantMessaging.InstantMessagingInterface_class=function(){};Object.extend(iMedix.Web.InstantMessaging.InstantMessagingInterface_class.prototype,Object.extend(new AjaxPro.AjaxClass(),{IMFetchMessages:function(conversationIDs){return this.invoke("IMFetchMessages",{"conversationIDs":conversationIDs},this.IMFetchMessages.getArguments().slice(1));},IMSendMessage:function(to,msgBody,conversationID){return this.invoke("IMSendMessage",{"to":to,"msgBody":msgBody,"conversationID":conversationID},this.IMSendMessage.getArguments().slice(3));},IMSendKeyBord:function(to,msgBody,conversationID){return this.invoke("IMSendKeyBord",{"to":to,"msgBody":msgBody,"conversationID":conversationID},this.IMSendKeyBord.getArguments().slice(3));},setStatus:function(status){return this.invoke("setStatus",{"status":status},this.setStatus.getArguments().slice(1));},ignore:function(ignoredUser){return this.invoke("ignore",{"ignoredUser":ignoredUser},this.ignore.getArguments().slice(1));},accept:function(acceptedUser,cid){return this.invoke("accept",{"acceptedUser":acceptedUser,"cid":cid},this.accept.getArguments().slice(2));},url:'/ajaxpro/iMedix.Web.AjaxProInterfaces.InstantMessaging.InstantMessagingInterface,App_Code.s4ovwmes.ashx'}));iMedix.Web.InstantMessaging.InstantMessagingInterface=new iMedix.Web.InstantMessaging.InstantMessagingInterface_class();if(typeof iMedix=="undefined")iMedix={};if(typeof iMedix.Web=="undefined")iMedix.Web={};if(typeof iMedix.Web.AutoSuggestions=="undefined")iMedix.Web.AutoSuggestions={};if(typeof iMedix.Web.AutoSuggestions.HealthLexicon_class=="undefined")iMedix.Web.AutoSuggestions.HealthLexicon_class={};iMedix.Web.AutoSuggestions.HealthLexicon_class=function(){};Object.extend(iMedix.Web.AutoSuggestions.HealthLexicon_class.prototype,Object.extend(new AjaxPro.AjaxClass(),{Suggest:function(input){return this.invoke("Suggest",{"input":input},this.Suggest.getArguments().slice(1));},url:'/ajaxpro/iMedix.Web.AjaxProInterfaces.AutoSuggestions.HealthLexicon,App_Code.s4ovwmes.ashx'}));iMedix.Web.AutoSuggestions.HealthLexicon=new iMedix.Web.AutoSuggestions.HealthLexicon_class();if(typeof iMedix=="undefined")iMedix={};if(typeof iMedix.Web=="undefined")iMedix.Web={};if(typeof iMedix.Web.AutoSuggestions=="undefined")iMedix.Web.AutoSuggestions={};if(typeof iMedix.Web.AutoSuggestions.UserNameLexicon_class=="undefined")iMedix.Web.AutoSuggestions.UserNameLexicon_class={};iMedix.Web.AutoSuggestions.UserNameLexicon_class=function(){};Object.extend(iMedix.Web.AutoSuggestions.UserNameLexicon_class.prototype,Object.extend(new AjaxPro.AjaxClass(),{Suggest:function(input){return this.invoke("Suggest",{"input":input},this.Suggest.getArguments().slice(1));},url:'/ajaxpro/iMedix.Web.AjaxProInterfaces.AutoSuggestions.UserNameLexicon,App_Code.s4ovwmes.ashx'}));iMedix.Web.AutoSuggestions.UserNameLexicon=new iMedix.Web.AutoSuggestions.UserNameLexicon_class();if(typeof iMedix=="undefined")iMedix={};if(typeof iMedix.Web=="undefined")iMedix.Web={};if(typeof iMedix.Web.AutoSuggestions=="undefined")iMedix.Web.AutoSuggestions={};if(typeof iMedix.Web.AutoSuggestions.TopicsLexicon_class=="undefined")iMedix.Web.AutoSuggestions.TopicsLexicon_class={};iMedix.Web.AutoSuggestions.TopicsLexicon_class=function(){};Object.extend(iMedix.Web.AutoSuggestions.TopicsLexicon_class.prototype,Object.extend(new AjaxPro.AjaxClass(),{Suggest:function(input){return this.invoke("Suggest",{"input":input},this.Suggest.getArguments().slice(1));},url:'/ajaxpro/iMedix.Web.AjaxProInterfaces.AutoSuggestions.TopicsLexicon,App_Code.s4ovwmes.ashx'}));iMedix.Web.AutoSuggestions.TopicsLexicon=new iMedix.Web.AutoSuggestions.TopicsLexicon_class();if(typeof iMedix=="undefined")iMedix={};if(typeof iMedix.Web=="undefined")iMedix.Web={};if(typeof iMedix.Web.UsersManagement=="undefined")iMedix.Web.UsersManagement={};if(typeof iMedix.Web.UsersManagement.UsersManagerInterface_class=="undefined")iMedix.Web.UsersManagement.UsersManagerInterface_class={};iMedix.Web.UsersManagement.UsersManagerInterface_class=function(){};Object.extend(iMedix.Web.UsersManagement.UsersManagerInterface_class.prototype,Object.extend(new AjaxPro.AjaxClass(),{fillStatesDdlByCountryID:function(CountryID){return this.invoke("fillStatesDdlByCountryID",{"CountryID":CountryID},this.fillStatesDdlByCountryID.getArguments().slice(1));},QueryUrlByCurrentStatus:function(service){return this.invoke("QueryUrlByCurrentStatus",{"service":service},this.QueryUrlByCurrentStatus.getArguments().slice(1));},TryLogin:function(Email,Password,rememberMe){return this.invoke("TryLogin",{"Email":Email,"Password":Password,"rememberMe":rememberMe},this.TryLogin.getArguments().slice(3));},SignOut:function(){return this.invoke("SignOut",{},this.SignOut.getArguments().slice(0));},SetUserTags:function(userTags){return this.invoke("SetUserTags",{"userTags":userTags},this.SetUserTags.getArguments().slice(1));},SignUp:function(sUserName,sPassword,sEmail,token,ReciveOffers,Campaign){return this.invoke("SignUp",{"sUserName":sUserName,"sPassword":sPassword,"sEmail":sEmail,"token":token,"ReciveOffers":ReciveOffers,"Campaign":Campaign},this.SignUp.getArguments().slice(6));},doAvailabilityCheck:function(userName){return this.invoke("doAvailabilityCheck",{"userName":userName},this.doAvailabilityCheck.getArguments().slice(1));},ForgotPassword:function(EmailAddress){return this.invoke("ForgotPassword",{"EmailAddress":EmailAddress},this.ForgotPassword.getArguments().slice(1));},ReportAbusingMemberPU:function(AbusingMemberName,comments,loc,internalID){return this.invoke("ReportAbusingMemberPU",{"AbusingMemberName":AbusingMemberName,"comments":comments,"loc":loc,"internalID":internalID},this.ReportAbusingMemberPU.getArguments().slice(4));},SendActivationMessage:function(EmailAddress){return this.invoke("SendActivationMessage",{"EmailAddress":EmailAddress},this.SendActivationMessage.getArguments().slice(1));},ImportContacts:function(emailAddress,password){return this.invoke("ImportContacts",{"emailAddress":emailAddress,"password":password},this.ImportContacts.getArguments().slice(2));},SendURLToFriend:function(url,InviterName,InviterText,FriendsEmail){return this.invoke("SendURLToFriend",{"url":url,"InviterName":InviterName,"InviterText":InviterText,"FriendsEmail":FriendsEmail},this.SendURLToFriend.getArguments().slice(4));},InviteFriends:function(InviterName,InviterText,FriendsEmail){return this.invoke("InviteFriends",{"InviterName":InviterName,"InviterText":InviterText,"FriendsEmail":FriendsEmail},this.InviteFriends.getArguments().slice(3));},InviteFriendsToBipolar:function(InviterName,InviterText,FriendsEmail){return this.invoke("InviteFriendsToBipolar",{"InviterName":InviterName,"InviterText":InviterText,"FriendsEmail":FriendsEmail},this.InviteFriendsToBipolar.getArguments().slice(3));},AddToBlockedList:function(UserName){return this.invoke("AddToBlockedList",{"UserName":UserName},this.AddToBlockedList.getArguments().slice(1));},RemoveFromBlockedList:function(UserName){return this.invoke("RemoveFromBlockedList",{"UserName":UserName},this.RemoveFromBlockedList.getArguments().slice(1));},AddToFriends:function(UserName,RequestText){return this.invoke("AddToFriends",{"UserName":UserName,"RequestText":RequestText},this.AddToFriends.getArguments().slice(2));},AcceptFriendshipRequest:function(RequesterName){return this.invoke("AcceptFriendshipRequest",{"RequesterName":RequesterName},this.AcceptFriendshipRequest.getArguments().slice(1));},DeclineFriendshipRequest:function(RequesterName){return this.invoke("DeclineFriendshipRequest",{"RequesterName":RequesterName},this.DeclineFriendshipRequest.getArguments().slice(1));},RemoveFromFriends:function(FriendName){return this.invoke("RemoveFromFriends",{"FriendName":FriendName},this.RemoveFromFriends.getArguments().slice(1));},SendFeedback:function(feedback){return this.invoke("SendFeedback",{"feedback":feedback},this.SendFeedback.getArguments().slice(1));},SetNewMessagesCount:function(Count){return this.invoke("SetNewMessagesCount",{"Count":Count},this.SetNewMessagesCount.getArguments().slice(1));},GetNewMessagesCount:function(){return this.invoke("GetNewMessagesCount",{},this.GetNewMessagesCount.getArguments().slice(0));},url:'/ajaxpro/iMedix.Web.AjaxProInterfaces.UsersManagement.UsersManagerInterface,App_Code.s4ovwmes.ashx'}));iMedix.Web.UsersManagement.UsersManagerInterface=new iMedix.Web.UsersManagement.UsersManagerInterface_class();if(typeof iMedix=="undefined")iMedix={};if(typeof iMedix.Web=="undefined")iMedix.Web={};if(typeof iMedix.Web.Helpers=="undefined")iMedix.Web.Helpers={};if(typeof iMedix.Web.Helpers.PopupHelper_class=="undefined")iMedix.Web.Helpers.PopupHelper_class={};iMedix.Web.Helpers.PopupHelper_class=function(){};Object.extend(iMedix.Web.Helpers.PopupHelper_class.prototype,Object.extend(new AjaxPro.AjaxClass(),{GetPopupContent:function(FileName,clientID,prm){return this.invoke("GetPopupContent",{"FileName":FileName,"clientID":clientID,"prm":prm},this.GetPopupContent.getArguments().slice(3));},GetHtmlContent:function(FilePath){return this.invoke("GetHtmlContent",{"FilePath":FilePath},this.GetHtmlContent.getArguments().slice(1));},url:'/ajaxpro/iMedix.Web.Helpers.PopupHelper,App_Code.s4ovwmes.ashx'}));iMedix.Web.Helpers.PopupHelper=new iMedix.Web.Helpers.PopupHelper_class();if(typeof iMedix=="undefined")iMedix={};if(typeof iMedix.Web=="undefined")iMedix.Web={};if(typeof iMedix.Web.Highlighter_class=="undefined")iMedix.Web.Highlighter_class={};iMedix.Web.Highlighter_class=function(){};Object.extend(iMedix.Web.Highlighter_class.prototype,Object.extend(new AjaxPro.AjaxClass(),{Extract:function(input){return this.invoke("Extract",{"input":input},this.Extract.getArguments().slice(1));},url:'/ajaxpro/iMedix.Web.AjaxProInterfaces.Highlighter.FarlexDictionaryInterface,App_Code.s4ovwmes.ashx'}));iMedix.Web.Highlighter=new iMedix.Web.Highlighter_class();